From 69d18ad7f05f093b06388877aa4a7b3d6f2664a6 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 3 May 2021 18:47:53 -0700 Subject: [PATCH] ZIR: typeof uses the un_node field not un_tok --- src/Sema.zig | 2 +- src/Zir.zig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Sema.zig b/src/Sema.zig index d58c9dc073..049b289cb8 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -4614,7 +4614,7 @@ fn zirTypeInfo(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerErro } fn zirTypeof(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { - const inst_data = sema.code.instructions.items(.data)[inst].un_tok; + const inst_data = sema.code.instructions.items(.data)[inst].un_node; const src = inst_data.src(); const operand = try sema.resolveInst(inst_data.operand); return sema.mod.constType(sema.arena, src, operand.ty); diff --git a/src/Zir.zig b/src/Zir.zig index dc2988c2c0..2d69b01fa6 100644 --- a/src/Zir.zig +++ b/src/Zir.zig @@ -523,7 +523,7 @@ pub const Inst = struct { /// Uses `un_node`. negate_wrap, /// Returns the type of a value. - /// Uses the `un_tok` field. + /// Uses the `un_node` field. typeof, /// Given a value which is a pointer, returns the element type. /// Uses the `un_node` field. @@ -1334,7 +1334,7 @@ pub const Inst = struct { .subwrap = .pl_node, .negate = .un_node, .negate_wrap = .un_node, - .typeof = .un_tok, + .typeof = .un_node, .typeof_elem = .un_node, .typeof_log2_int_type = .un_node, .log2_int_type = .un_node,