From 17bdfbb08b925b218d5cfcf9ebd32903d14f8732 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 14 Jun 2020 11:58:20 -0500 Subject: [PATCH] Fix broken trace functionality. This was an older regression that caused trace to emit garbage output in most cases. --- src/core/vm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/vm.c b/src/core/vm.c index bb87b62a..07cc3e07 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -929,7 +929,7 @@ static JanetSignal run_vm(JanetFiber *fiber, Janet in) { if (janet_checktype(callee, JANET_FUNCTION)) { func = janet_unwrap_function(callee); if (func->gc.flags & JANET_FUNCFLAG_TRACE) { - vm_do_trace(func, fiber->stacktop - fiber->stackstart, stack); + vm_do_trace(func, fiber->stacktop - fiber->stackstart, fiber->data + fiber->stackstart); } janet_stack_frame(stack)->pc = pc; if (janet_fiber_funcframe(fiber, func)) { @@ -968,7 +968,7 @@ static JanetSignal run_vm(JanetFiber *fiber, Janet in) { if (janet_checktype(callee, JANET_FUNCTION)) { func = janet_unwrap_function(callee); if (func->gc.flags & JANET_FUNCFLAG_TRACE) { - vm_do_trace(func, fiber->stacktop - fiber->stackstart, stack); + vm_do_trace(func, fiber->stacktop - fiber->stackstart, fiber->data + fiber->stackstart); } if (janet_fiber_funcframe_tail(fiber, func)) { janet_stack_frame(fiber->data + fiber->frame)->pc = pc;