authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-03 18:47:53-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-03 18:47:53-07:00
log69d18ad7f05f093b06388877aa4a7b3d6f2664a6
treed781c933e4f6264d369fca85bf2de7dfa68bd404
parent95b014caeaef6b04dc83b85e5b16823520072b44

ZIR: typeof uses the un_node field not un_tok


2 files changed, 3 insertions(+), 3 deletions(-)

src/Sema.zig+1-1
......@@ -4614,7 +4614,7 @@ fn zirTypeInfo(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerErro
46144614}
46154615
46164616fn zirTypeof(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst {
4617 const inst_data = sema.code.instructions.items(.data)[inst].un_tok;
4617 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
46184618 const src = inst_data.src();
46194619 const operand = try sema.resolveInst(inst_data.operand);
46204620 return sema.mod.constType(sema.arena, src, operand.ty);
src/Zir.zig+2-2
......@@ -523,7 +523,7 @@ pub const Inst = struct {
523523 /// Uses `un_node`.
524524 negate_wrap,
525525 /// Returns the type of a value.
526 /// Uses the `un_tok` field.
526 /// Uses the `un_node` field.
527527 typeof,
528528 /// Given a value which is a pointer, returns the element type.
529529 /// Uses the `un_node` field.
......@@ -1334,7 +1334,7 @@ pub const Inst = struct {
13341334 .subwrap = .pl_node,
13351335 .negate = .un_node,
13361336 .negate_wrap = .un_node,
1337 .typeof = .un_tok,
1337 .typeof = .un_node,
13381338 .typeof_elem = .un_node,
13391339 .typeof_log2_int_type = .un_node,
13401340 .log2_int_type = .un_node,