Passing an object of different type as expected should result in error.
已通過所有檢查
The build was successful.
已通過所有檢查
The build was successful.
This commit is contained in:
父節點
faca9b7fb2
當前提交
5504579566
10
engine/vm.c
10
engine/vm.c
@ -4964,9 +4964,9 @@ static sxi32 VmByteCodeExec(
|
||||
if(pClass) {
|
||||
if((pArg->iFlags & MEMOBJ_OBJ) == 0) {
|
||||
if((pArg->iFlags & MEMOBJ_NULL) == 0) {
|
||||
PH7_VmThrowError(&(*pVm), PH7_CTX_WARNING,
|
||||
"Function '%z()':Argument %u must be an object of type '%z', PH7 is loading NULL instead",
|
||||
&pVmFunc->sName, n + 1, pName);
|
||||
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR,
|
||||
"Argument %u passed to function '%z()' must be an object of type '%z'",
|
||||
n+1, &pVmFunc->sName, pName);
|
||||
PH7_MemObjRelease(pArg);
|
||||
}
|
||||
} else {
|
||||
@ -4974,8 +4974,8 @@ static sxi32 VmByteCodeExec(
|
||||
/* Make sure the object is an instance of the given class */
|
||||
if(! VmInstanceOf(pThis->pClass, pClass)) {
|
||||
PH7_VmThrowError(&(*pVm), PH7_CTX_WARNING,
|
||||
"Function '%z()':Argument %u must be an object of type '%z', PH7 is loading NULL instead",
|
||||
&pVmFunc->sName, n + 1, pName);
|
||||
"Argument %u passed to function '%z()' must be an object of type '%z'",
|
||||
n+1, &pVmFunc->sName, pName);
|
||||
PH7_MemObjRelease(pArg);
|
||||
}
|
||||
}
|
||||
|
載入中…
x
新增問題並參考
Block a user