summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-06-21 01:35:22 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-06-21 01:35:22 +0200
commit115e9288bbd28f7ad525ebcc0053908464be5c95 (patch)
tree6c1117d4bf1634a817da23272fc4df569e2fe4bc /Zend/zend_execute.c
parentf58ebb36094e6c59d4e87bfba2a0504858adbec9 (diff)
downloadphp-git-115e9288bbd28f7ad525ebcc0053908464be5c95.tar.gz
Fix segfault with scalar passed to typehint with not loaded class
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 491dbb8e68..246372fee2 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -780,7 +780,11 @@ static zend_always_inline int zend_verify_arg_type(zend_function *zf, uint32_t a
} else {
ce = zend_verify_arg_class_kind(cur_arg_info);
if (UNEXPECTED(!ce)) {
- zend_verify_arg_error(zf, arg_num, "be an instance of ", cur_arg_info->class_name->val, "instance of ", Z_OBJCE_P(arg)->name->val, arg);
+ if (Z_TYPE_P(arg) == IS_OBJECT) {
+ zend_verify_arg_error(zf, arg_num, "be an instance of ", cur_arg_info->class_name->val, "instance of ", Z_OBJCE_P(arg)->name->val, arg);
+ } else {
+ zend_verify_arg_error(zf, arg_num, "be an instance of ", cur_arg_info->class_name->val, "", zend_zval_type_name(arg), arg);
+ }
return 0;
}
*cache_slot = (void*)ce;