aboutsummaryrefslogtreecommitdiff
path: root/src/compile.zig
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2025-05-31 22:54:26 +0200
committerMathias Magnusson <mathias@magnusson.space>2025-05-31 22:54:26 +0200
commit5749be69125dc87ac50742295272a7e21f4f472e (patch)
treecf0aa4776eda997f94ef35e06e41f16678aedebd /src/compile.zig
parent590a76edb6a88f754a43e96f16f2fc73845238b5 (diff)
downloadhuginn-5749be69125dc87ac50742295272a7e21f4f472e.tar.gz
codegen integer literals correctly
This was not as easy as one would expect ☠️
Diffstat (limited to 'src/compile.zig')
-rw-r--r--src/compile.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compile.zig b/src/compile.zig
index ad5fc59..c723842 100644
--- a/src/compile.zig
+++ b/src/compile.zig
@@ -102,7 +102,7 @@ const CompileContext = struct {
switch (expr.type) {
.integer_literal => try addInstr(self, .{
.loc = expr.loc,
- .type = .{ .constant = .{ .dest = dest, .value = expr.getInt(self.source) } },
+ .type = .{ .constant = .{ .dest = dest, .value = expr.loc.getInt(self.source) } },
}),
.bin_op => |binop| {
const lhs = try self.compileExpr(binop.lhs);