You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hotfix pass singleton tuples as single elements to closures (#815)
This PR implements a special calling convention applied to _closures_:
* The first argument is the closure's environment (currently not supported nor are types extracted in stable-mir-json)
* The second argument is a _tuple_ that needs to be unpacked and the individual components stored as locals `_2` to `_N`
The `Assert` terminator checks that an operand holding a boolean value (which has previously been computed, e.g., an overflow flag for arithmetic operations) has the expected value (e.g., that this overflow flag is `false` - a very common case).
414
515
If the condition value is as expected, the program proceeds with the given `target` block.
415
516
Otherwise the provided message is passed to a `panic!` call, ending the program with an error, modelled as an `AssertError` in the semantics.
- The stuck state occurs because there's a Deref projection that needs to be applied to the single element of this Aggregate, but the existing Deref rules only handle pointers and references, not Aggregates
453
-
454
-
With this rule enabled:
455
-
- The execution progresses further to 277 steps before getting stuck
456
-
- It gets stuck at a different location: `#traverseProjection ( toLocal ( 19 ) , thunk ( #decodeConstant ( constantKindAll ... ) ) , ... )`
457
-
- The rule automatically unwraps the single-element Aggregate, allowing the field access to proceed
458
-
459
-
This rule is essential for handling closures that access struct fields, as MIR represents certain struct accesses through single-element Aggregates that need to be unwrapped.
0 commit comments