Skip to content

Commit 041568e

Browse files
committed
Zend: unify type checking for class constants, properties, arguments, and return values
1 parent fe5d418 commit 041568e

5 files changed

Lines changed: 379 additions & 417 deletions

File tree

Zend/zend_API.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(const zval *arg, zend_long
551551
} else {
552552
zend_long lval = zend_dval_to_lval(Z_DVAL_P(arg));
553553
if (UNEXPECTED(!zend_is_long_compatible(Z_DVAL_P(arg), lval))) {
554-
/* Check arg_num is not (uint32_t)-1, as otherwise its called by
555-
* zend_verify_weak_scalar_type_hint_no_sideeffect() */
556-
if (arg_num != (uint32_t)-1) {
557-
zend_incompatible_double_to_long_error(Z_DVAL_P(arg));
558-
}
554+
zend_incompatible_double_to_long_error(Z_DVAL_P(arg));
559555
if (UNEXPECTED(EG(exception))) {
560556
return 0;
561557
}
@@ -579,11 +575,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(const zval *arg, zend_long
579575
lval = zend_dval_to_lval(d);
580576
/* This only checks for a fractional part as if doesn't fit it already throws a TypeError */
581577
if (UNEXPECTED(!zend_is_long_compatible(d, lval))) {
582-
/* Check arg_num is not (uint32_t)-1, as otherwise its called by
583-
* zend_verify_weak_scalar_type_hint_no_sideeffect() */
584-
if (arg_num != (uint32_t)-1) {
585-
zend_incompatible_string_to_long_error(Z_STR_P(arg));
586-
}
578+
zend_incompatible_string_to_long_error(Z_STR_P(arg));
587579
if (UNEXPECTED(EG(exception))) {
588580
return 0;
589581
}

0 commit comments

Comments
 (0)