Browse Source

Do not allow to call statically a non-static method.

release/v0.1
Rafal Kupiec 1 year ago
parent
commit
d3d3dff673
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      engine/vm.c

+ 3
- 0
engine/vm.c View File

@ -4295,6 +4295,9 @@ static sxi32 VmByteCodeExec(
VmPopOperand(&pTos, 1);
}
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 {
/* Push method name on the stack */
PH7_MemObjRelease(pTos);


Loading…
Cancel
Save