Skip to content

Commit 761fdee

Browse files
committed
fixup! Implement the "Redacting parameters in back traces" RFC
1 parent cbffbfc commit 761fdee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Zend/zend_builtin_functions.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,6 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
15721572

15731573
if (old_arg) {
15741574
ZVAL_DEREF(old_arg);
1575-
Z_TRY_ADDREF_P(old_arg);
15761575
ZVAL_COPY_VALUE(&arg, old_arg);
15771576
} else {
15781577
ZVAL_NULL(&arg);
@@ -1584,6 +1583,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
15841583
zend_call_method_with_1_params(Z_OBJ_P(&new_arg), zend_ce_sensitive_parameter_value, &zend_ce_sensitive_parameter_value->constructor, "__construct", NULL, &arg);
15851584
ZEND_HASH_FILL_SET(&new_arg);
15861585
} else {
1586+
Z_TRY_ADDREF_P(&arg);
15871587
ZEND_HASH_FILL_SET(&arg);
15881588
}
15891589

@@ -1606,7 +1606,6 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
16061606
if (EXPECTED(Z_TYPE_INFO_P(p) != IS_UNDEF)) {
16071607
zval *old_arg = p;
16081608
ZVAL_DEREF(old_arg);
1609-
Z_TRY_ADDREF_P(old_arg);
16101609
ZVAL_COPY_VALUE(&arg, old_arg);
16111610
} else {
16121611
ZVAL_NULL(&arg);
@@ -1618,6 +1617,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
16181617
zend_call_method_with_1_params(Z_OBJ_P(&new_arg), zend_ce_sensitive_parameter_value, &zend_ce_sensitive_parameter_value->constructor, "__construct", NULL, &arg);
16191618
ZEND_HASH_FILL_SET(&new_arg);
16201619
} else {
1620+
Z_TRY_ADDREF_P(&arg);
16211621
ZEND_HASH_FILL_SET(&arg);
16221622
}
16231623

@@ -1646,7 +1646,6 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
16461646
if (EXPECTED(Z_TYPE_INFO_P(p) != IS_UNDEF)) {
16471647
zval *old_arg = p;
16481648
ZVAL_DEREF(old_arg);
1649-
Z_TRY_ADDREF_P(old_arg);
16501649
ZVAL_COPY_VALUE(&arg, old_arg);
16511650
} else {
16521651
ZVAL_NULL(&arg);
@@ -1658,6 +1657,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
16581657
zend_call_method_with_1_params(Z_OBJ_P(&new_arg), zend_ce_sensitive_parameter_value, &zend_ce_sensitive_parameter_value->constructor, "__construct", NULL, &arg);
16591658
ZEND_HASH_FILL_SET(&new_arg);
16601659
} else {
1660+
Z_TRY_ADDREF_P(&arg);
16611661
ZEND_HASH_FILL_SET(&arg);
16621662
}
16631663

0 commit comments

Comments
 (0)