From a6f7c6d847db3327c3432ca8c353fa3ec284b3d2 Mon Sep 17 00:00:00 2001 From: belliash Date: Wed, 29 May 2019 13:45:38 +0200 Subject: [PATCH] Prevent $base, $parent and $this from being unset. --- engine/vm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/vm.c b/engine/vm.c index 8bcb080..d23e942 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -7580,6 +7580,10 @@ static int vm_builtin_unset(ph7_context *pCtx, int nArg, ph7_value **apArg) { PH7_VmThrowError(pCtx->pVm, PH7_CTX_ERR, "Expecting a variable not a constant"); } } else { + if(pObj->iFlags != MEMOBJ_VARIABLE) { + /* Throw an error */ + PH7_VmThrowError(pCtx->pVm, PH7_CTX_ERR, "Expecting a variable not AerScript statement"); + } sxu32 nIdx = pObj->nIdx; PH7_VmUnsetMemObj(&(*pVm), nIdx, FALSE); }