From d135748bcdf1ab77f92d42cf16c4522eed5d56af Mon Sep 17 00:00:00 2001 From: belliash Date: Sun, 2 Sep 2018 18:53:23 +0200 Subject: [PATCH] Always iterate through all frames. --- engine/vm.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/engine/vm.c b/engine/vm.c index 9d29340..b138260 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -1755,7 +1755,7 @@ static const char *VmInstrToString(sxi32 nOp); /* * This routine is used to dump the debug stacktrace based on all active frames. */ -PH7_PRIVATE sxi32 VmExtractDebugTrace(ph7_vm *pVm, SySet *pDebugTrace, sxbool bAllFrames) { +PH7_PRIVATE sxi32 VmExtractDebugTrace(ph7_vm *pVm, SySet *pDebugTrace) { sxi32 iDepth = 0; sxi32 rc = SXRET_OK; /* Initialize the container */ @@ -1798,9 +1798,6 @@ PH7_PRIVATE sxi32 VmExtractDebugTrace(ph7_vm *pVm, SySet *pDebugTrace, sxbool bA break; } } - if(!bAllFrames) { - break; - } /* Roll frame */ pVm->pFrame = pVm->pFrame->pParent; } @@ -9223,7 +9220,7 @@ static int vm_builtin_debug_backtrace(ph7_context *pCtx, int nArg, ph7_value **a VmDebugTrace *pTrace; ph7_value *pArray; /* Extract debug information */ - if(VmExtractDebugTrace(&(*pVm), &pDebug, TRUE) != SXRET_OK) { + if(VmExtractDebugTrace(&(*pVm), &pDebug) != SXRET_OK) { ph7_result_null(pCtx); return PH7_OK; }