From: Derick Rethans Date: Sun, 8 Feb 2009 19:36:33 +0000 (+0000) Subject: - MFH: Fixed bug #47341: Calling gc_collect_cycles() with zend.enable_gc=0 X-Git-Tag: RELEASE_1_3_5~168 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a1ff72729e1898f569c8dde71d564df6bbdae06;p=php - MFH: Fixed bug #47341: Calling gc_collect_cycles() with zend.enable_gc=0 causes segfault. --- diff --git a/Zend/tests/gc_031.phpt b/Zend/tests/gc_031.phpt new file mode 100644 index 0000000000..25f8513cfa --- /dev/null +++ b/Zend/tests/gc_031.phpt @@ -0,0 +1,11 @@ +--TEST-- +GC 031: gc_collect_roots() with GC turned off. +--INI-- +zend.gc_enable=1 +--FILE-- + +--EXPECTF-- +DONE diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index 69fbe16603..5475edb3d4 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -527,7 +527,7 @@ ZEND_API int gc_collect_cycles(TSRMLS_D) { int count = 0; - if (GC_G(roots).next != &GC_G(roots)) { + if (GC_G(roots).next != &GC_G(roots) && GC_G(roots).next) { zval_gc_info *p, *q, *orig_free_list, *orig_next_to_free; if (GC_G(gc_active)) {