Allow non-static methods inside static (final virtual) classes to be called statically.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-05-30 12:43:54 +02:00
parent ba1c840009
commit a3a2c8b619
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 1 additions and 1 deletions

View File

@ -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)) {