Skip to content

Commit 5bb74c4

Browse files
committed
fxies
1 parent dd931ba commit 5bb74c4

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Zend/zend_API.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,7 @@ ZEND_API zend_opt_long ZEND_FASTCALL zend_flf_parse_arg_long_slow(const zval *ar
663663
ZEND_API zend_opt_double ZEND_FASTCALL zend_parse_arg_double_weak(const zval *arg, uint32_t arg_num) /* {{{ */
664664
{
665665
zend_opt_double result;
666+
result.has_value = false;
666667
if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) {
667668
result.value = (double)Z_LVAL_P(arg);
668669
} else if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) {
@@ -677,12 +678,10 @@ ZEND_API zend_opt_double ZEND_FASTCALL zend_parse_arg_double_weak(const zval *ar
677678
return result;
678679
}
679680
if (UNEXPECTED(EG(exception))) {
680-
result.has_value = false;
681681
return result;
682682
}
683683
} else if (EXPECTED(Z_TYPE_P(arg) < IS_TRUE)) {
684684
if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("float", arg_num)) {
685-
result.has_value = false;
686685
return result;
687686
}
688687
result.value = 0.0;

Zend/zend_execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ static bool zend_verify_weak_scalar_type_hint(uint32_t type_mask, zval *arg)
757757
zend_opt_double result = zend_parse_arg_double_weak(arg, 0);
758758
if (result.has_value) {
759759
zval_ptr_dtor(arg);
760-
ZVAL_DOUBLE(arg, dval);
760+
ZVAL_DOUBLE(arg, result.value);
761761
return 1;
762762
}
763763
}

0 commit comments

Comments
 (0)