Browse Source

Fix segmentation fault on Program::__construct() call.

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

+ 2
- 2
engine/vm.c 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) {


Loading…
Cancel
Save