From f5779438613a43ba6fd161800eb2e35cb33ac6ec Mon Sep 17 00:00:00 2001 From: belliash Date: Thu, 12 Jul 2018 15:48:30 +0200 Subject: [PATCH] Fix VmEvalChunk() to also initialize and install static and constant class attributes --- vm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vm.c b/vm.c index 5075235..1c3bd6c 100644 --- a/vm.c +++ b/vm.c @@ -10464,6 +10464,17 @@ static sxi32 VmEvalChunk( } }else{ ph7_value sResult; /* Return value */ + SyHashEntry *pEntry; + /* Initialize and install static and constants class attributes */ + SyHashResetLoopCursor(&pVm->hClass); + while((pEntry = SyHashGetNextEntry(&pVm->hClass)) != 0 ){ + if (VmMountUserClass(&(*pVm),(ph7_class *)pEntry->pUserData) != SXRET_OK ){ + if( pCtx ){ + ph7_result_bool(pCtx,0); + } + goto Cleanup; + } + } if( SXRET_OK != PH7_VmEmitInstr(pVm,PH7_OP_DONE,0,0,0,0) ){ /* Out of memory */ if( pCtx ){