Work around miscompilation

This commit is contained in:
kayomn 2023-08-21 12:27:02 +01:00
parent 0d6e5250c7
commit 56d9899ac2
1 changed files with 4 additions and 1 deletions

View File

@ -42,10 +42,13 @@ pub const BinaryOperator = enum {
"`"); "`");
} }
// TODO: Remove once Zig has fixed struct self-reassignment.
const unnecessary_temp = try coral.io.allocate_one(allocator, expression);
expression = .{ expression = .{
.binary_operation = .{ .binary_operation = .{
.operator = operator, .operator = operator,
.lhs_expression = try coral.io.allocate_one(allocator, expression), .lhs_expression = unnecessary_temp,
.rhs_expression = try coral.io.allocate_one(allocator, try build_next(self)), .rhs_expression = try coral.io.allocate_one(allocator, try build_next(self)),
}, },
}; };