Do not allow to call statically a non-static method.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-05-09 06:18:49 +02:00
parent c4416ef631
commit d3d3dff673
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 3 additions and 0 deletions

View File

@ -4295,6 +4295,9 @@ static sxi32 VmByteCodeExec(
VmPopOperand(&pTos, 1); VmPopOperand(&pTos, 1);
} }
PH7_MemObjRelease(pTos); PH7_MemObjRelease(pTos);
} else if((pMeth->iFlags & PH7_CLASS_ATTR_STATIC) == 0) {
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Attempt to call statically a non-static method '%z::%z()'",
&pClass->sName, &sName);
} else { } else {
/* Push method name on the stack */ /* Push method name on the stack */
PH7_MemObjRelease(pTos); PH7_MemObjRelease(pTos);