Browse Source

Release VM and exit automatically, do not rely on VM.

release/v0.1
Rafal Kupiec 3 years ago
parent
commit
f176414bce
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
1 changed files with 6 additions and 8 deletions
  1. +6
    -8
      engine/vm.c

+ 6
- 8
engine/vm.c View File

@ -1894,11 +1894,9 @@ PH7_PRIVATE sxi32 PH7_VmMemoryError(
/* Consume the error message */
VmCallErrorHandler(&(*pVm), &sWorker);
}
/* Set exit code to 255 */
pVm->iExitStatus = 255;
/* There is no need to release VM. The script execution will automatically
* get aborted and VM will be properly shut down when returned SXERR_ABORT */
return SXERR_ABORT;
/* Release the VM gracefully and abort script execution */
PH7_VmRelease(pVm);
exit(255);
}
/*
* Throw a run-time error and invoke the supplied VM output consumer callback.
@ -1974,9 +1972,9 @@ PH7_PRIVATE sxi32 PH7_VmGenericError(
rc = VmCallErrorHandler(&(*pVm), &sWorker);
}
if(iErr == PH7_CTX_ERR) {
/* Set exit code to 255 and abort script execution */
pVm->iExitStatus = 255;
rc = SXERR_ABORT;
/* Release the VM gracefully and abort script execution */
PH7_VmRelease(pVm);
exit(255);
}
return rc;
}


Loading…
Cancel
Save