Skip to content

Commit

Permalink
stage2: fix inline fn parameter debug info being added to wrong block
Browse files Browse the repository at this point in the history
  • Loading branch information
Vexu committed Mar 19, 2022
1 parent 1e1f740 commit d56e3c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Sema.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4853,14 +4853,14 @@ fn analyzeCall(
const param_name = sema.code.nullTerminatedString(extra.data.name);
const inst = sema.inst_map.get(param).?;

try sema.addDbgVar(block, inst, .dbg_var_val, param_name);
try sema.addDbgVar(&child_block, inst, .dbg_var_val, param_name);
},
.param_anytype, .param_anytype_comptime => {
const inst_data = sema.code.instructions.items(.data)[param].str_tok;
const param_name = inst_data.get(sema.code);
const inst = sema.inst_map.get(param).?;

try sema.addDbgVar(block, inst, .dbg_var_val, param_name);
try sema.addDbgVar(&child_block, inst, .dbg_var_val, param_name);
},
else => continue,
};
Expand Down
4 changes: 2 additions & 2 deletions src/print_air.zig
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ const Writer = struct {
}

fn writeShuffle(w: *Writer, s: anytype, inst: Air.Inst.Index) @TypeOf(s).Error!void {
const pl_op = w.air.instructions.items(.data)[inst].pl_op;
const extra = w.air.extraData(Air.Shuffle, pl_op.payload).data;
const ty_pl = w.air.instructions.items(.data)[inst].ty_pl;
const extra = w.air.extraData(Air.Shuffle, ty_pl.payload).data;

try w.writeOperand(s, inst, 0, extra.a);
try s.writeAll(", ");
Expand Down

0 comments on commit d56e3c9

Please sign in to comment.