From 1a48d81848d22420f6460622a1077940ecd04a9d Mon Sep 17 00:00:00 2001 From: Evan Haas Date: Wed, 16 Oct 2024 17:12:57 -0700 Subject: [PATCH] Parser: clear value if dereferencing pointer/array/function --- src/aro/Parser.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aro/Parser.zig b/src/aro/Parser.zig index 968944a4..843ba771 100644 --- a/src/aro/Parser.zig +++ b/src/aro/Parser.zig @@ -7103,7 +7103,6 @@ fn computeOffsetExtra(p: *Parser, node: NodeIndex, offset_so_far: *Value) !Value _ = try offset_so_far.add(field_offset, offset_so_far.*, p.comp.types.ptrdiff, p.comp); return p.computeOffsetExtra(member.lhs, offset_so_far); }, - .deref_expr, .addr_of_expr => return offset_so_far.*, else => return .{}, } } @@ -7195,6 +7194,7 @@ fn unExpr(p: *Parser) Error!Result { if (operand.ty.isArray() or operand.ty.isPtr() or operand.ty.isFunc()) { try operand.lvalConversion(p); operand.ty = operand.ty.elemType(); + operand.val = .{}; } else { try p.errTok(.indirection_ptr, tok); }