Browse Source

Try to exit with code returned by Program::main() only when it is integer value.

pull/50/head
Rafal Kupiec 2 years ago
parent
commit
f3d10dd4bc
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      engine/vm.c

+ 4
- 1
engine/vm.c View File

@ -5506,7 +5506,10 @@ PH7_PRIVATE sxi32 PH7_VmByteCodeExec(ph7_vm *pVm) {
/* Call entry point */
PH7_VmCallClassMethod(&(*pVm), pInstance, pMethod, &pResult, 1, &pArgs);
if(!pVm->iExitStatus) {
pVm->iExitStatus = ph7_value_to_int(&pResult);
if(pMethod->sFunc.nType == MEMOBJ_INT) {
pVm->iExitStatus = ph7_value_to_int(&pResult);
} else {
pVm->iExitStatus = 0;
}
/* Invoke any shutdown callbacks */
VmInvokeShutdownCallbacks(&(*pVm));


Loading…
Cancel
Save