Allow non-static methods inside static (final virtual) classes to be called statically.
All checks were successful
The build was successful.
All checks were successful
The build was successful.
This commit is contained in:
parent
ba1c840009
commit
a3a2c8b619
@ -4333,7 +4333,7 @@ static sxi32 VmByteCodeExec(
|
|||||||
VmPopOperand(&pTos, 1);
|
VmPopOperand(&pTos, 1);
|
||||||
}
|
}
|
||||||
PH7_MemObjRelease(pTos);
|
PH7_MemObjRelease(pTos);
|
||||||
} else if((pMeth->iFlags & PH7_CLASS_ATTR_STATIC) == 0) {
|
} else if((pMeth->iFlags & PH7_CLASS_ATTR_STATIC) == 0 && ((pClass->iFlags & PH7_CLASS_FINAL) == 0 || (pClass->iFlags & PH7_CLASS_VIRTUAL) == 0)) {
|
||||||
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Attempt to call statically a non-static method '%z::%z()'",
|
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Attempt to call statically a non-static method '%z::%z()'",
|
||||||
&pClass->sName, &sName);
|
&pClass->sName, &sName);
|
||||||
} else if(!VmClassMemberAccess(&(*pVm), pClass, pMeth->iProtection)) {
|
} else if(!VmClassMemberAccess(&(*pVm), pClass, pMeth->iProtection)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user