commit 8279bce074808482fd72f510e8d4526ba9c8a73f
parent 06d14f43fba0142b757b6d7575e558cd4c6cf5c2
Author: Walther Chen <walther.chen@gmail.com>
Date: Fri, 11 Nov 2022 21:42:34 -0500
fix comptime on tracing
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/src/opt1.zig b/src/opt1.zig
@@ -24,6 +24,7 @@ test "og: interpret hello world" {
fn interpret(program: Program, memory: []u8, rdr: anytype, wtr: anytype, alloc: Allocator) !void {
var instruction_count = if (TRACE) std.AutoHashMap(u8, usize).init(alloc) else undefined;
+ comptime var instruction_count = if (TRACE) std.AutoHashMap(u8, usize).init(alloc) else undefined;
if (TRACE) {
defer instruction_count.deinit();
}