From 5eeceb69270afd4b9d3f36d831b7d5f80c7598c7 Mon Sep 17 00:00:00 2001 From: belliash Date: Wed, 3 Apr 2019 13:43:31 +0200 Subject: [PATCH] Try to optimize the code a bit. --- engine/vm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/vm.c b/engine/vm.c index 50cf111..624539d 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -4836,14 +4836,14 @@ static sxi32 VmByteCodeExec( if(pObj == 0 || pVal == 0) { PH7_VmMemoryError(&(*pVm)); } + MemObjSetType(pObj, pStatic->iFlags); if(SySetUsed(&pStatic->aByteCode) > 0) { /* Evaluate initialization expression (Any complex expression) */ VmLocalExec(&(*pVm), &pStatic->aByteCode, pVal); - } - MemObjSetType(pObj, pStatic->iFlags); - rc = PH7_MemObjSafeStore(pVal, pObj); - if(rc != SXRET_OK) { - PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Cannot assign a value of incompatible type to variable '$%z'", &pStatic->sName); + rc = PH7_MemObjSafeStore(pVal, pObj); + if(rc != SXRET_OK) { + PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Cannot assign a value of incompatible type to variable '$%z'", &pStatic->sName); + } } pObj->nIdx = pStatic->nIdx; }