Finally, do not allow a string variables to act as callback.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2018-12-20 19:37:03 +01:00
parent 4db8ec02cd
commit bbdc740388
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 4 additions and 1 deletions

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);