mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 22:33:08 +00:00
Thanks to jacobly0 for figuring this out. The chain of events causing the failure this triggered is as follows. * As of a recent commit, certain bodies no longer emit a redundant `block`, meaning there are more likely to be "interesting" instructions (i.e. not blocks) at the end of parent GenZir scopes. * When emitting the first `dbg_stmt` in such a body, the elision logic incorrectly looks at a tag from an instruction in an enclosing scope. * The tag of this instruction may be `undefined`, meaning that in unsafe builds it may be incorrectly identified as a `dbg_stmt` instruction. * This instruction from another body is clobbered rather than emitting an actual `dbg_stmt` instruction. Note that this does not produce invalid ZIR, since the creator of the undefined instruction replaces the previously-undefined payload later.