File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #79247 (Garbage collecting variant objects segfaults)
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ('com_dotnet ' )) die ('skip com_dotnet extension not available ' );
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ $ keep = new variant (null );
10
+ var_dump (gc_collect_cycles ());
11
+ ?>
12
+ --EXPECT--
13
+ int(0)
Original file line number Diff line number Diff line change @@ -227,6 +227,13 @@ static HashTable *com_properties_get(zend_object *object)
227
227
return & zend_empty_array ;
228
228
}
229
229
230
+ static HashTable * com_get_gc (zval * object , zval * * table , int * n )
231
+ {
232
+ * table = NULL ;
233
+ * n = 0 ;
234
+ return NULL ;
235
+ }
236
+
230
237
static void function_dtor (zval * zv )
231
238
{
232
239
zend_internal_function * f = (zend_internal_function * )Z_PTR_P (zv );
@@ -552,7 +559,7 @@ zend_object_handlers php_com_object_handlers = {
552
559
com_object_count ,
553
560
NULL , /* get_debug_info */
554
561
NULL , /* get_closure */
555
- zend_std_get_gc , /* get_gc */
562
+ com_get_gc , /* get_gc */
556
563
NULL , /* do_operation */
557
564
com_objects_compare , /* compare */
558
565
NULL , /* get_properties_for */
You can’t perform that action at this time.
0 commit comments