From 62c315da9e65a568c52b1d39c0f68039c9b8ea4b Mon Sep 17 00:00:00 2001 From: belliash Date: Sun, 28 Apr 2019 21:44:48 +0200 Subject: [PATCH] Call to undefined constant should lead to an error. --- engine/vm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/vm.c b/engine/vm.c index a9bb154..7e6dfd5 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -2450,6 +2450,9 @@ static sxi32 VmByteCodeExec( /* Mark as constant */ pTos->nIdx = SXU32_HIGH; break; + } else if(pInstr[1].iOp != PH7_OP_MEMBER && pInstr[1].iOp != PH7_OP_NEW && pInstr[2].iOp != PH7_OP_MEMBER && pInstr[1].iOp != PH7_OP_NEW) { + PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, + "Call to undefined constant ā€˜%sā€™", SyBlobData(&pObj->sBlob)); } } PH7_MemObjLoad(pObj, pTos);