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:
@@ -4333,7 +4333,7 @@ static sxi32 VmByteCodeExec(
|
||||
VmPopOperand(&pTos, 1);
|
||||
}
|
||||
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()'",
|
||||
&pClass->sName, &sName);
|
||||
} else if(!VmClassMemberAccess(&(*pVm), pClass, pMeth->iProtection)) {
|
||||
|
Reference in New Issue
Block a user