From 369cadfcdaae372c436014ce2bd0ed8c8a6f5892 Mon Sep 17 00:00:00 2001 From: belliash Date: Mon, 24 Sep 2018 12:10:19 +0200 Subject: [PATCH] Tryeing to call a non-instantiated object should result in an error. --- engine/vm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/vm.c b/engine/vm.c index 638403f..95711d2 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -4383,6 +4383,9 @@ static sxi32 VmByteCodeExec( } #endif if(pNos->iFlags & MEMOBJ_OBJ) { + if(!pNos->x.pOther) { + PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Call to non-instantiated object '$%z'", &sName); + } ph7_class *pClass; /* Class already instantiated */ pThis = (ph7_class_instance *)pNos->x.pOther;