Skip to content

Commit dd931ba

Browse files
committed
wip
1 parent 863dac5 commit dd931ba

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

Zend/zend_API.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ ZEND_API zend_opt_double ZEND_FASTCALL zend_parse_arg_double_slow(const zval *ar
711711
}
712712
/* }}} */
713713

714-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest, uint32_t arg_num) /* {{{ */
714+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, uint32_t arg_num) /* {{{ */
715715
{
716716
if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) {
717717
return 0;
@@ -739,13 +739,12 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest, u
739739
} else {
740740
return 0;
741741
}
742-
*dest = arg;
743742
return 1;
744743
}
745744
/* }}} */
746745

747746

748-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_or_str_slow(zval *arg, zval **dest, uint32_t arg_num) /* {{{ */
747+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_or_str_slow(zval *arg, uint32_t arg_num) /* {{{ */
749748
{
750749
if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) {
751750
return false;
@@ -763,14 +762,12 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_or_str_slow(zval *arg, zval **
763762
if (zobj->handlers->cast_object(zobj, &obj, IS_STRING) == SUCCESS) {
764763
OBJ_RELEASE(zobj);
765764
ZVAL_COPY_VALUE(arg, &obj);
766-
*dest = arg;
767765
return true;
768766
}
769767
return false;
770768
} else {
771769
return false;
772770
}
773-
*dest = arg;
774771
return true;
775772
}
776773

Zend/zend_API.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,8 +2198,8 @@ ZEND_API zend_opt_double ZEND_FASTCALL zend_parse_arg_double_slow(const zval *ar
21982198
ZEND_API zend_opt_double ZEND_FASTCALL zend_parse_arg_double_weak(const zval *arg, uint32_t arg_num);
21992199
ZEND_API zend_string * ZEND_FASTCALL zend_parse_arg_str_slow(zval *arg, uint32_t arg_num);
22002200
ZEND_API zend_string * ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, uint32_t arg_num);
2201-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest, uint32_t arg_num);
2202-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_or_str_slow(zval *arg, zval **dest, uint32_t arg_num);
2201+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, uint32_t arg_num);
2202+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_or_str_slow(zval *arg, uint32_t arg_num);
22032203
ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_or_long_slow(zval *arg, zend_string **dest_str, zend_long *dest_long, uint32_t arg_num);
22042204

22052205
ZEND_API zend_opt_bool ZEND_FASTCALL zend_flf_parse_arg_bool_slow(const zval *arg, uint32_t arg_num);
@@ -2298,7 +2298,11 @@ static zend_always_inline bool zend_parse_arg_number(zval *arg, zval **dest, boo
22982298
} else if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) {
22992299
*dest = NULL;
23002300
} else {
2301-
return zend_parse_arg_number_slow(arg, dest, arg_num);
2301+
if (zend_parse_arg_number_slow(arg, arg_num)) {
2302+
*dest = arg;
2303+
} else {
2304+
return 0;
2305+
}
23022306
}
23032307
return 1;
23042308
}
@@ -2310,7 +2314,11 @@ static zend_always_inline bool zend_parse_arg_number_or_str(zval *arg, zval **de
23102314
} else if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) {
23112315
*dest = NULL;
23122316
} else {
2313-
return zend_parse_arg_number_or_str_slow(arg, dest, arg_num);
2317+
if (zend_parse_arg_number_or_str_slow(arg, arg_num)) {
2318+
*dest = arg;
2319+
} else {
2320+
return false;
2321+
}
23142322
}
23152323
return true;
23162324
}

0 commit comments

Comments
 (0)