-
Notifications
You must be signed in to change notification settings - Fork 467
Tail calls end protectors too early #3788
Copy link
Copy link
Closed
Labels
A-aliasingArea: This affects the aliasing model (Stacked/Tree Borrows)Area: This affects the aliasing model (Stacked/Tree Borrows)C-spec-questionCategory: it is unclear what the intended behavior of Miri for this case isCategory: it is unclear what the intended behavior of Miri for this case is
Metadata
Metadata
Assignees
Labels
A-aliasingArea: This affects the aliasing model (Stacked/Tree Borrows)Area: This affects the aliasing model (Stacked/Tree Borrows)C-spec-questionCategory: it is unclear what the intended behavior of Miri for this case isCategory: it is unclear what the intended behavior of Miri for this case is
Type
Fields
Give feedbackNo fields configured for issues without a type.
In a tail call,
before_stack_popgets called before the stack frame is replaced with that of the new function. This ends the corresponding protectors in Miri, which is premature: they should instead be carried over to the new stack frame, and only ended when we return back to the caller.This affects both protection of function arguments and, perhaps even more relevant, the return place.
Currently it is hard to write a test case since custom MIR does not yet support tail calls (support is being added in rust-lang/rust#128688).