cvs: ZendEngine2 / zend_gc.c /tests gc_031.phpt

[email protected] ("Derick Rethans") Sun, 08 Feb 2009 19:30:01 -0000
Newsgroups php.zend-engine.cvs
Message-ID <cvsderick1234121401@cvsserver>
derick		Sun Feb  8 19:30:01 2009 UTC

  Added files:                 
    /ZendEngine2/tests	gc_031.phpt 

  Modified files:              
    /ZendEngine2	zend_gc.c 
  Log:
  - Fixed bug #47341: Calling gc_collect_cycles() with zend.enable_gc=0 causes
    segfault.
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_gc.c?r1=1.19&r2=1.20&diff_format=u
Index: ZendEngine2/zend_gc.c
diff -u ZendEngine2/zend_gc.c:1.19 ZendEngine2/zend_gc.c:1.20
--- ZendEngine2/zend_gc.c:1.19	Fri Jan  2 20:36:30 2009
+++ ZendEngine2/zend_gc.c	Sun Feb  8 19:30:01 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_gc.c,v 1.19 2009/01/02 20:36:30 felipe Exp $ */
+/* $Id: zend_gc.c,v 1.20 2009/02/08 19:30:01 derick Exp $ */
 
 #include "zend.h"
 #include "zend_API.h"
@@ -527,7 +527,7 @@
 {
 	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)) {

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/gc_031.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/gc_031.phpt
+++ ZendEngine2/tests/gc_031.phpt
--TEST--
GC 031: gc_collect_roots() with GC turned off.
--INI--
zend.enable_gc=0
--FILE--
<?php
gc_collect_cycles();
echo "DONE\n";
?>
--EXPECTF--
DONE