Skip to content

Commit 3e7211c

Browse files
committed
docs(kmir): explain ignored return sentinel
1 parent 4b850ca commit 3e7211c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • kmir/src/kmir/kdist/mir-semantics

kmir/src/kmir/kdist/mir-semantics/kmir.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ NB that a stack height of `0` cannot occur here, because the compiler prevents l
219219
If the local `_0` does not have a value (i.e., it remained uninitialised), the function returns unit and writing the value is skipped.
220220

221221
```k
222+
// `place(local(-1), .ProjectionElems)` is a sentinel destination meaning that the caller
223+
// ignores the callee's return value. Skip the normal writeback path in that case, because
224+
// `#setLocalValue` only accepts real local indices and would get stuck on `local(-1)`.
222225
rule [termReturnIgnored]: <k> #execTerminator(terminator(terminatorKindReturn, _SPAN)) ~> _
223226
=>
224227
#execBlockIdx(TARGET)

0 commit comments

Comments
 (0)