From d58249cb3f85d6b8851e32ea771c4f2086afa94b Mon Sep 17 00:00:00 2001 From: belliash Date: Wed, 5 Sep 2018 13:16:57 +0200 Subject: [PATCH] Use debug trace only if VM is really executing some code. --- engine/vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/vm.c b/engine/vm.c index d9382bd..74f1805 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -1920,7 +1920,7 @@ PH7_PRIVATE sxi32 PH7_VmThrowError( sxu32 nLine; SyString sFileName; SyString *pFile; - if((VmExtractDebugTrace(&(*pVm), &pDebug) == SXRET_OK) && (SySetUsed(&pDebug) > 0)) { + if((pVm->nMagic == PH7_VM_EXEC) && (VmExtractDebugTrace(&(*pVm), &pDebug) == SXRET_OK) && (SySetUsed(&pDebug) > 0)) { /* Extract file name and line number from debug trace */ SySetGetNextEntry(&pDebug, (void **)&pTrace); pFile = pTrace->pFile;