Skip to content

Commit

Permalink
Parser: clear value if dereferencing pointer/array/function
Browse files Browse the repository at this point in the history
  • Loading branch information
ehaas committed Oct 17, 2024
1 parent b328498 commit 1a48d81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/aro/Parser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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 .{},
}
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 1a48d81

Please sign in to comment.