Skip to content

debugging trans: initialize drop-flag byte with special pattern and check for it on drop #21777

Closed
@pnkfelix

Description

@pnkfelix

So, there are sometimes bugs in trans related to allocating stack slots for temporary values, but not properly ensuring that the slots are either always initialized or start off with the drop flag zeroed.

A way we could try to guard for such bugs would be: in debug builds, initialize the drop flag with a non-trivial bit pattern, and then check for that bit pattern when dropping the value.

I strongly suspect a check like this would have helped us track down the cause of #20055 faster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationA-destructorsArea: Destructors (`Drop`, …)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions