File tree 2 files changed +25
-3
lines changed 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -1806,7 +1806,15 @@ static zend_always_inline void i_free_compiled_variables(zend_execute_data *exec
1806
1806
zval * cv = EX_VAR_NUM (0 );
1807
1807
zval * end = cv + EX (func )-> op_array .last_var ;
1808
1808
while (EXPECTED (cv != end )) {
1809
- zval_ptr_dtor (cv );
1809
+ if (Z_REFCOUNTED_P (cv )) {
1810
+ if (!Z_DELREF_P (cv )) {
1811
+ zend_refcounted * r = Z_COUNTED_P (cv );
1812
+ ZVAL_NULL (cv );
1813
+ zval_dtor_func_for_ptr (r );
1814
+ } else {
1815
+ GC_ZVAL_CHECK_POSSIBLE_ROOT (cv );
1816
+ }
1817
+ }
1810
1818
cv ++ ;
1811
1819
}
1812
1820
}
Original file line number Diff line number Diff line change @@ -199,7 +199,15 @@ static zend_always_inline void zend_vm_stack_free_extra_args_ex(uint32_t call_in
199
199
zval * p = end + (ZEND_CALL_NUM_ARGS (call ) - call -> func -> op_array .num_args );
200
200
do {
201
201
p -- ;
202
- i_zval_ptr_dtor (p ZEND_FILE_LINE_CC );
202
+ if (Z_REFCOUNTED_P (p )) {
203
+ if (!Z_DELREF_P (p )) {
204
+ zend_refcounted * r = Z_COUNTED_P (p );
205
+ ZVAL_NULL (p );
206
+ zval_dtor_func_for_ptr (r );
207
+ } else {
208
+ GC_ZVAL_CHECK_POSSIBLE_ROOT (p );
209
+ }
210
+ }
203
211
} while (p != end );
204
212
}
205
213
}
@@ -219,7 +227,13 @@ static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call)
219
227
220
228
do {
221
229
p -- ;
222
- zval_ptr_dtor_nogc (p );
230
+ if (Z_REFCOUNTED_P (p )) {
231
+ if (!Z_DELREF_P (p )) {
232
+ zend_refcounted * r = Z_COUNTED_P (p );
233
+ ZVAL_NULL (p );
234
+ zval_dtor_func_for_ptr (r );
235
+ }
236
+ }
223
237
} while (p != end );
224
238
}
225
239
}
You can’t perform that action at this time.
0 commit comments