Throw an error if $key or $value does not exist.
All checks were successful
The build was successful.
All checks were successful
The build was successful.
This commit is contained in:
parent
5c1e0f0cce
commit
a726ab795a
10
engine/vm.c
10
engine/vm.c
@ -4095,15 +4095,17 @@ static sxi32 VmByteCodeExec(
|
||||
} else {
|
||||
if(SyStringLength(&pInfo->sKey) > 0) {
|
||||
ph7_value *pKey = VmExtractMemObj(&(*pVm), &pInfo->sKey, FALSE, FALSE);
|
||||
if(pKey) {
|
||||
PH7_HashmapExtractNodeKey(pNode, pKey);
|
||||
if(pKey == 0) {
|
||||
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Variable '$%z' undeclared (first use in this method/closure)", &pInfo->sKey);
|
||||
}
|
||||
PH7_HashmapExtractNodeKey(pNode, pKey);
|
||||
}
|
||||
/* Make a copy of the entry value */
|
||||
pValue = VmExtractMemObj(&(*pVm), &pInfo->sValue, FALSE, FALSE);
|
||||
if(pValue) {
|
||||
PH7_HashmapExtractNodeValue(pNode, pValue, TRUE);
|
||||
if(pValue == 0) {
|
||||
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Variable '$%z' undeclared (first use in this method/closure)", &pInfo->sValue);
|
||||
}
|
||||
PH7_HashmapExtractNodeValue(pNode, pValue, TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user