Skip to content

Commit d3b030e

Browse files
committed
fixes
1 parent 63bfd30 commit d3b030e

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

Zend/zend_API.c

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -568,9 +568,9 @@ ZEND_API zend_opt_long ZEND_FASTCALL zend_parse_arg_long_weak(const zval *arg, u
568568
* zend_verify_weak_scalar_type_hint_no_sideeffect() */
569569
if (arg_num != (uint32_t)-1) {
570570
zend_incompatible_double_to_long_error(Z_DVAL_P(arg));
571-
}
572-
if (UNEXPECTED(EG(exception))) {
573-
goto fail;
571+
if (UNEXPECTED(EG(exception))) {
572+
goto fail;
573+
}
574574
}
575575
}
576576
return (zend_opt_long){lval, true};
@@ -596,17 +596,16 @@ ZEND_API zend_opt_long ZEND_FASTCALL zend_parse_arg_long_weak(const zval *arg, u
596596
* zend_verify_weak_scalar_type_hint_no_sideeffect() */
597597
if (arg_num != (uint32_t)-1) {
598598
zend_incompatible_string_to_long_error(Z_STR_P(arg));
599-
}
600-
if (UNEXPECTED(EG(exception))) {
601-
goto fail;
599+
if (UNEXPECTED(EG(exception))) {
600+
goto fail;
601+
}
602602
}
603603
}
604+
} else {
605+
goto fail;
604606
}
605-
return (zend_opt_long){lval, true};
606-
}
607-
if (UNEXPECTED(EG(exception))) {
608-
goto fail;
609607
}
608+
return (zend_opt_long){lval, true};
610609
} else if (EXPECTED(Z_TYPE_P(arg) < IS_TRUE)) {
611610
if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("int", arg_num)) {
612611
goto fail;
@@ -654,20 +653,13 @@ ZEND_API zend_opt_double ZEND_FASTCALL zend_parse_arg_double_weak(const zval *ar
654653
double d;
655654

656655
if (UNEXPECTED((type = is_numeric_str_function(Z_STR_P(arg), &l, &d)) != IS_DOUBLE)) {
657-
zend_opt_double result;
658656
if (EXPECTED(type != 0)) {
659-
result.value = (double)(l);
660-
result.has_value = true;
661-
} else {
662-
result.has_value = false;
657+
return (zend_opt_double){(double)l, true};
663658
}
664-
return result;
659+
goto fail;
665660
} else {
666661
return (zend_opt_double){d, true};
667662
}
668-
if (UNEXPECTED(EG(exception))) {
669-
goto fail;
670-
}
671663
} else if (EXPECTED(Z_TYPE_P(arg) < IS_TRUE)) {
672664
if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("float", arg_num)) {
673665
goto fail;

0 commit comments

Comments
 (0)