Fix uninitialized value leading to segmentation fault.
All checks were successful
The build was successful.

This commit is contained in:
Rafal Kupiec 2018-08-27 20:23:08 +02:00
parent 6a14e88973
commit 37c960e313
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -5493,6 +5493,7 @@ PH7_PRIVATE sxi32 PH7_VmByteCodeExec(ph7_vm *pVm) {
if(!pMethod) {
VmErrorFormat(&(*pVm), PH7_CTX_ERR, "Cannot find a program entry point 'Program::main()'");
}
PH7_MemObjInit(pVm, &pResult);
PH7_VmCallClassMethod(&(*pVm), pInstance, pMethod, &pResult, 0, 0);
if(!pVm->iExitStatus) {
pVm->iExitStatus = ph7_value_to_int(&pResult);