Skip to content

Commit bb54694

Browse files
committed
Fix refcounting
1 parent 6b6c2c0 commit bb54694

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

Zend/zend_execute_API.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
796796
if (EXPECTED(!must_wrap)) {
797797
ZVAL_COPY(param, arg);
798798
} else {
799+
Z_TRY_ADDREF_P(arg);
799800
ZVAL_NEW_REF(param, arg);
800801
}
801802
}

Zend/zend_vm_def.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5153,6 +5153,7 @@ ZEND_VM_C_LABEL(send_array):
51535153
if (EXPECTED(!must_wrap)) {
51545154
ZVAL_COPY(param, arg);
51555155
} else {
5156+
Z_TRY_ADDREF_P(arg);
51565157
ZVAL_NEW_REF(param, arg);
51575158
}
51585159
ZEND_CALL_NUM_ARGS(EX(call))++;
@@ -5186,6 +5187,7 @@ ZEND_VM_C_LABEL(send_array):
51865187
if (EXPECTED(!must_wrap)) {
51875188
ZVAL_COPY(param, arg);
51885189
} else {
5190+
Z_TRY_ADDREF_P(arg);
51895191
ZVAL_NEW_REF(param, arg);
51905192
}
51915193
ZEND_CALL_NUM_ARGS(EX(call))++;

Zend/zend_vm_execute.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2097,6 +2097,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_O
20972097
if (EXPECTED(!must_wrap)) {
20982098
ZVAL_COPY(param, arg);
20992099
} else {
2100+
Z_TRY_ADDREF_P(arg);
21002101
ZVAL_NEW_REF(param, arg);
21012102
}
21022103
ZEND_CALL_NUM_ARGS(EX(call))++;
@@ -2130,6 +2131,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_O
21302131
if (EXPECTED(!must_wrap)) {
21312132
ZVAL_COPY(param, arg);
21322133
} else {
2134+
Z_TRY_ADDREF_P(arg);
21332135
ZVAL_NEW_REF(param, arg);
21342136
}
21352137
ZEND_CALL_NUM_ARGS(EX(call))++;

0 commit comments

Comments
 (0)