Tail calls end protectors too early #3788
Labels
A-aliasing
Area: This affects the aliasing model (Stacked/Tree Borrows)
C-spec-question
Category: it is unclear what the intended behavior of Miri for this case is
In a tail call,
before_stack_pop
gets 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).
The text was updated successfully, but these errors were encountered: