Move VM initialization into separate step to enable errors reporting earlier.

This commit is contained in:
2018-07-25 18:15:40 +02:00
parent 7bf76c3fa0
commit 63b0f450d3
3 changed files with 70 additions and 53 deletions

View File

@@ -1412,10 +1412,6 @@ PH7_PRIVATE sxi32 PH7_VmMakeReady(
if(pVm->aOps == 0) {
return SXERR_MEM;
}
/* Set the default VM output consumer callback and it's
* private data. */
pVm->sVmConsumer.xConsumer = PH7_VmBlobConsumer;
pVm->sVmConsumer.pUserData = &pVm->sConsumer;
/* Allocate the reference table */
pVm->nRefSize = 0x10; /* Must be a power of two for fast arithemtic */
pVm->apRefObj = (VmRefObj **)SyMemBackendAlloc(&pVm->sAllocator, sizeof(VmRefObj *) * pVm->nRefSize);