Skip to content

Tail calls end protectors too early #3788

Closed
@RalfJung

Description

@RalfJung

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-aliasingArea: This affects the aliasing model (Stacked/Tree Borrows)C-spec-questionCategory: it is unclear what the intended behavior of Miri for this case is

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions