From ce851b5df50ffbd3c2a518b93f773ebbb400cb20 Mon Sep 17 00:00:00 2001 From: belliash Date: Thu, 6 Jun 2019 20:32:12 +0200 Subject: [PATCH] Do not try to load constant on OP_IS. --- engine/vm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/vm.c b/engine/vm.c index 4273f7a..51df0e2 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -2432,7 +2432,7 @@ static sxi32 VmByteCodeExec( pTos++; if((pObj = (ph7_value *)SySetAt(&pVm->aLitObj, pInstr->iP2)) != 0) { if(pInstr->iP1 == 1 && SyBlobLength(&pObj->sBlob) <= 64) { - if(pInstr[1].iOp != PH7_OP_MEMBER && pInstr[1].iOp != PH7_OP_NEW) { + if(pInstr[1].iOp != PH7_OP_MEMBER && pInstr[1].iOp != PH7_OP_NEW && pInstr[1].iOp != PH7_OP_IS) { /* Point to the top active frame */ VmFrame *pFrame = pVm->pFrame; while(pFrame->pParent && (pFrame->iFlags & VM_FRAME_EXCEPTION)) { @@ -2462,7 +2462,7 @@ static sxi32 VmByteCodeExec( /* Mark as constant */ pTos->nIdx = SXU32_HIGH; break; - } else if(pInstr[2].iOp != PH7_OP_MEMBER && pInstr[2].iOp != PH7_OP_NEW) { + } else if(pInstr[2].iOp != PH7_OP_MEMBER && pInstr[2].iOp != PH7_OP_NEW && pInstr[2].iOp != PH7_OP_IS) { PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Call to undefined constant ā€˜%sā€™", SyBlobData(&pObj->sBlob)); }