Fix #36, unrolling through the frames needed to also reset to the initial frame after

This commit is contained in:
David Carlier 2018-08-07 13:55:13 +00:00
parent cdc58f2795
commit a0fb911d7a
1 changed files with 2 additions and 0 deletions

View File

@ -9349,6 +9349,7 @@ static int vm_builtin_debug_backtrace(ph7_context *pCtx, int nArg, ph7_value **a
/* Create a new array */ /* Create a new array */
pArray = ph7_context_new_array(pCtx); pArray = ph7_context_new_array(pCtx);
pValue = ph7_context_new_scalar(pCtx); pValue = ph7_context_new_scalar(pCtx);
VmFrame *oFrame = pVm->pFrame;
iLine = -1; iLine = -1;
if(pArray == 0 || pValue == 0) { if(pArray == 0 || pValue == 0) {
/* Out of memory,return NULL */ /* Out of memory,return NULL */
@ -9429,6 +9430,7 @@ static int vm_builtin_debug_backtrace(ph7_context *pCtx, int nArg, ph7_value **a
rollFrame: rollFrame:
pVm->pFrame = pVm->pFrame->pParent; pVm->pFrame = pVm->pFrame->pParent;
} }
pVm->pFrame = oFrame;
/* Return the freshly created array */ /* Return the freshly created array */
ph7_result_value(pCtx, pArray); ph7_result_value(pCtx, pArray);
/* /*