Fix segmentation fault on Program::__construct() call.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-04-17 17:29:05 +02:00
parent f8a47d2838
commit 407bcf5a29
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 2 additions and 2 deletions

View File

@ -5274,14 +5274,14 @@ PH7_PRIVATE sxi32 PH7_VmByteCodeExec(ph7_vm *pVm) {
if(pInstance == 0) {
PH7_VmMemoryError(&(*pVm));
}
/* Enable garbage collector */
pInstance->iRef--;
/* Check if a constructor is available */
pMethod = PH7_ClassExtractMethod(pClass, "__construct", sizeof("__construct") - 1);
if(pMethod) {
/* Call the class constructor */
PH7_VmCallClassMethod(&(*pVm), pInstance, pMethod, 0, 0, 0);
}
/* Enable garbage collector */
pInstance->iRef--;
pArgs = ph7_new_array(&(*pVm));
sArgv = ph7_new_scalar(&(*pVm));
if(!pArgs || !sArgv) {