make AIR instruction for assembly not reference ZIR #10784
Labels
bug
Observed behavior contradicts documented or intended behavior
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
frontend
Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone
zig/src/Air.zig
Lines 665 to 669 in 1b6a1e6
This is problematic because it causes
Problem is that the ZIR we pass to Liveness analysis (and to codegen later) is for a particular Decl that could have inlined code, causing an assembly ZIR instruction from a different file to be in the AIR for the Decl. This means we are looking up a ZIR instruction index in the wrong ZIR object.
This is the only AIR instruction that references a ZIR instruction.
The solution is pretty straightforward: instead of trying to cut corners, change the AIR encoding to duplicate all the info from the ZIR that it needs, and uphold the property that ZIR is not needed in order to decode AIR.
The text was updated successfully, but these errors were encountered: