Closed thekid closed 10 years ago
Seems VmEvalChunk()
forgets to to call VmMountUserClass
on classes declared iside the given PHP chunk, so adding:
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;
}
}
...inside the else
block of if( pVm->sCodeGen.nErr > 0 )
and before if( SXRET_OK != PH7_VmEmitInstr(pVm,PH7_OP_DONE,0,0,0,0) )
(around line 13300 in ph7.c) fixes the thing
I'd come up with a PR but this is only the generated ("amalgamated") code here, so that's probably useless.
Nice hack, will merge this with with the main trunk soon. Thanks for your contribution!
So far, so good. Now let x.php run inside an
include()
context:Enabling errors yields the following: