Fix static variables not containing any value.
All checks were successful
The build was successful.

This commit is contained in:
Rafal Kupiec 2018-09-21 22:18:11 +02:00
parent f927667d85
commit 514e07c7f3
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -4949,7 +4949,7 @@ static sxi32 VmByteCodeExec(
/* Evaluate initialization expression (Any complex expression) */
VmLocalExec(&(*pVm), &pStatic->aByteCode, pObj);
}
if(pObj->iFlags != pStatic->iFlags) {
if((pObj->iFlags & MEMOBJ_NULL) == 0 && pObj->iFlags != pStatic->iFlags) {
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR,
"Value does not match the data type of '$%z' variable", &pStatic->sName);
}