Skip to content

Commit 3eea5da

Browse files
committed
Zend: unify type checking for class constants, properties, arguments, and return values
1 parent c4d8337 commit 3eea5da

5 files changed

Lines changed: 366 additions & 406 deletions

File tree

Zend/zend_API.c

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

0 commit comments

Comments
 (0)