Fix segmentation fault when trying to clone non-instantiated object.
已通過所有檢查
The build was successful.

This commit is contained in:
Rafal Kupiec 2019-04-24 16:51:43 +02:00
父節點 555234e381
當前提交 5b0b965199
簽署人: belliash
GPG 金鑰 ID: 4E829243E0CFE6B4

查看文件

@ -4553,7 +4553,7 @@ static sxi32 VmByteCodeExec(
} }
#endif #endif
/* Make sure we are dealing with a class instance */ /* Make sure we are dealing with a class instance */
if((pTos->iFlags & MEMOBJ_OBJ) == 0) { if((pTos->iFlags & MEMOBJ_OBJ) == 0 || pTos->x.pOther == 0) {
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, PH7_VmThrowError(&(*pVm), PH7_CTX_ERR,
"Clone: Expecting a class instance as left operand"); "Clone: Expecting a class instance as left operand");
PH7_MemObjRelease(pTos); PH7_MemObjRelease(pTos);