Skip to content

Commit 5358c7c

Browse files
Replace dead branch with ZEND_ASSERT()
1 parent 9d03310 commit 5358c7c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Zend/zend_execute.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -823,11 +823,8 @@ static zend_always_inline int zend_verify_arg_type(zend_function *zf, uint32_t a
823823
} else {
824824
ce = zend_verify_arg_class_kind(cur_arg_info);
825825
if (UNEXPECTED(!ce)) {
826-
if (Z_TYPE_P(arg) == IS_OBJECT) {
827-
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "instance of ", ZSTR_VAL(Z_OBJCE_P(arg)->name), arg);
828-
} else {
829-
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "", zend_zval_type_name(arg), arg);
830-
}
826+
ZEND_ASSERT(Z_TYPE_P(arg) != IS_OBJECT);
827+
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "", zend_zval_type_name(arg), arg);
831828
return 0;
832829
}
833830
*cache_slot = (void*)ce;

0 commit comments

Comments
 (0)