Skip to content

Commit 6dd6b7e

Browse files
committed
fix(rt): set closure env local in tuple-arg setup
1 parent 5a9ac28 commit 6dd6b7e

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,9 @@ Therefore a heuristics is used here:
530530
_SPAN
531531
)
532532
=>
533-
#setTupleArgs(2, getValue(LOCALS, TUPLE)) ~> #execBlock(FIRST)
533+
#setLocalValue(place(local(1), .ProjectionElems), #incrementRef(getValue(LOCALS, CLOSURE)))
534+
~> #setTupleArgs(2, getValue(LOCALS, TUPLE))
535+
~> #execBlock(FIRST)
534536
// arguments are tuple components, stored as _2 .. _n
535537
...
536538
</k>
@@ -562,7 +564,9 @@ Therefore a heuristics is used here:
562564
_SPAN
563565
)
564566
=>
565-
#setTupleArgs(2, getValue(LOCALS, TUPLE)) ~> #execBlock(FIRST)
567+
#setLocalValue(place(local(1), .ProjectionElems), #incrementRef(getValue(LOCALS, CLOSURE)))
568+
~> #setTupleArgs(2, getValue(LOCALS, TUPLE))
569+
~> #execBlock(FIRST)
566570
// arguments are tuple components, stored as _2 .. _n
567571
...
568572
</k>
@@ -579,7 +583,7 @@ Therefore a heuristics is used here:
579583
andBool 0 <=Int TUPLE andBool TUPLE <Int size(LOCALS)
580584
andBool isTypedValue(LOCALS[TUPLE])
581585
andBool isTupleType(lookupTy(tyOfLocal({LOCALS[TUPLE]}:>TypedLocal)))
582-
andBool isTypedLocal(LOCALS[CLOSURE])
586+
andBool isTypedValue(LOCALS[CLOSURE])
583587
// or the closure ref type pointee is missing from the type table
584588
andBool isRefType(lookupTy(tyOfLocal({LOCALS[CLOSURE]}:>TypedLocal)))
585589
andBool isTy(pointeeTy(lookupTy(tyOfLocal({LOCALS[CLOSURE]}:>TypedLocal))))

kmir/src/tests/integration/data/prove-rs/show/iter-eq-copied-take-dereftruncate-fail.repro.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
│ #execTerminator ( terminator ( ... kind: terminatorKindCall ( ... func: operandC
44
│ span: 0
55
6-
│ (1947 steps)
6+
│ (5553 steps)
77
└─ 3 (stuck, leaf)
8-
#traverseProjection ( toLocal ( 1 ) , thunk ( operandCopy ( place ( ... local: l
9-
span: 30
8+
#traverseProjection ( toLocal ( 12 ) , thunk ( #decodeConstant ( constantKindAll
9+
span: 282
1010

1111

1212
┌─ 2 (root, leaf, target, terminal)

0 commit comments

Comments
 (0)