Throw an error if $key or $value does not exist.
The build was successful.
Details
The build was successful.
Details
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 {
|
} else {
|
||||||
if(SyStringLength(&pInfo->sKey) > 0) {
|
if(SyStringLength(&pInfo->sKey) > 0) {
|
||||||
ph7_value *pKey = VmExtractMemObj(&(*pVm), &pInfo->sKey, FALSE, FALSE);
|
ph7_value *pKey = VmExtractMemObj(&(*pVm), &pInfo->sKey, FALSE, FALSE);
|
||||||
if(pKey) {
|
if(pKey == 0) {
|
||||||
PH7_HashmapExtractNodeKey(pNode, pKey);
|
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 */
|
/* Make a copy of the entry value */
|
||||||
pValue = VmExtractMemObj(&(*pVm), &pInfo->sValue, FALSE, FALSE);
|
pValue = VmExtractMemObj(&(*pVm), &pInfo->sValue, FALSE, FALSE);
|
||||||
if(pValue) {
|
if(pValue == 0) {
|
||||||
PH7_HashmapExtractNodeValue(pNode, pValue, TRUE);
|
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Variable '$%z' undeclared (first use in this method/closure)", &pInfo->sValue);
|
||||||
}
|
}
|
||||||
|
PH7_HashmapExtractNodeValue(pNode, pValue, TRUE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue