Treat empty object as false.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2018-09-24 13:38:33 +02:00
parent 2db1954779
commit f26095658d
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 3 additions and 0 deletions

View File

@ -315,6 +315,9 @@ static sxi32 MemObjBooleanValue(ph7_value *pObj) {
sxi32 iVal = 1;
sxi32 rc;
/* Invoke the __toBool() method if available [note that this is a symisc extension] */
if(!pObj->x.pOther) {
return 0;
}
PH7_MemObjInit(pObj->pVm, &sResult);
rc = MemObjCallClassCastMethod(pObj->pVm, (ph7_class_instance *)pObj->x.pOther,
"__toBool", sizeof("__toBool") - 1, &sResult);