Fix SlotCarrierMismatch for mutable owned aggregate params#1503
Open
sbillig wants to merge 1 commit into
Open
Conversation
A `mut own` aggregate parameter is passed by value, so its carrier is fixed by the interface signature and the runtime verifier requires it to stay exactly equal to the signature param class. Carrier inference was upgrading such params to an object-ref carrier when they needed projectable owned storage, contradicting the by-value param class and tripping the verifier with SlotCarrierMismatch. Pin signature-visible parameter carriers in both LocalStateInferer and ReturnSliceInferer so inference never moves them off their seed. The owned-storage need is satisfied by a Slot root instead, which the Sonatina backend already lowers by storing the incoming arg into the slot in the prologue. Add an fe_test regression fixture covering array, struct, nested, and index-mutation shapes of the pattern, plus an invariant-level unit test (runtime_handle_preservation_keeps_mut_owned_aggregate_param_by_value) that asserts the parameter keeps a by-value aggregate carrier backed by a slot root, guarding against an ABI-widening "fix" that the behavioral fixture alone would not catch.
2362524 to
1e08976
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #1421
A
mut ownaggregate parameter is passed by value, so its carrier is fixed by the interface signature and the runtime verifier requires it to stay exactly equal to the signature param class. Carrier inference was upgrading such params to an object-ref carrier when they needed projectable owned storage, contradicting the by-value param class and tripping the verifier with SlotCarrierMismatch.