haku2: add stats + fix crash w uninit vm

This commit is contained in:
りき萌 2025-06-16 16:39:54 +02:00
parent e667c6336a
commit 00a48527ca
12 changed files with 88 additions and 71 deletions

View file

@ -12,11 +12,11 @@ const Value = value.Value;
const Vm = @This();
stack: []Value,
stack: []Value = &.{},
stack_top: u32 = 0,
call_stack: []CallFrame,
call_stack: []CallFrame = &.{},
call_stack_top: u32 = 0,
defs: []Value,
defs: []Value = &.{},
fuel: u32 = 0, // NOTE: VM must be refueled via reset() before running code
exception: ?Exception = null,