From 67ce98d9244d32bd30e38c7a74763eb9c293f86c Mon Sep 17 00:00:00 2001 From: belliash Date: Fri, 31 Aug 2018 08:30:59 +0200 Subject: [PATCH] Look for executed OP_CALL. Each function contains a list of all instructions inside, thus we should consider only OP_CALL that has already been executed. As the list is browsed from bottom to top, no more checks are necessary. The first match is what we are looking for. --- engine/vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/vm.c b/engine/vm.c index b77cfdf..e289533 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -1775,7 +1775,7 @@ PH7_PRIVATE sxi32 VmExtractDebugTrace(ph7_vm *pVm, SySet *pDebugTrace, sxbool bA aTrace.pArg = &pVm->pFrame->sArg; for(sxi32 i = (SySetUsed(aByteCode) - 1); i >= 0 ; i--) { VmInstr *cInstr = (VmInstr *)SySetAt(aByteCode, i); - if(cInstr->iP2) { + if(cInstr->iOp == PH7_OP_CALL && cInstr->bExec == TRUE) { /* Extract file name & line */ aTrace.pFile = cInstr->pFile; aTrace.nLine = cInstr->iLine;