Browse Source

Finally, do not allow a string variables to act as callback.

pull/50/head
Rafal Kupiec 2 years ago
parent
commit
bbdc740388
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      engine/vm.c

+ 4
- 1
engine/vm.c View File

@ -4843,8 +4843,11 @@ static sxi32 VmByteCodeExec(
ph7_value *pArg = &pTos[-pInstr->iP1];
SyHashEntry *pEntry;
SyString sName;
VmInstr *bInstr = &aInstr[pc - 1];
/* Extract function name */
if((pTos->iFlags & (MEMOBJ_CALL | MEMOBJ_STRING)) == 0) {
if(pTos->iFlags & MEMOBJ_STRING && bInstr->iOp == PH7_OP_LOAD) {
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Calling a non-callable object");
} else if((pTos->iFlags & (MEMOBJ_CALL | MEMOBJ_STRING)) == 0) {
if(pTos->iFlags & MEMOBJ_HASHMAP) {
ph7_value sResult;
SySetReset(&aArg);


Loading…
Cancel
Save