mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
- Fixed bug #47341: Calling gc_collect_cycles() with zend.enable_gc=0 causes
segfault.
This commit is contained in:
parent
4164e522c6
commit
201c26283c
2 changed files with 12 additions and 1 deletions
11
Zend/tests/gc_031.phpt
Normal file
11
Zend/tests/gc_031.phpt
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
--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
|
|
@ -527,7 +527,7 @@ ZEND_API int gc_collect_cycles(TSRMLS_D)
|
||||||
{
|
{
|
||||||
int count = 0;
|
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;
|
zval_gc_info *p, *q, *orig_free_list, *orig_next_to_free;
|
||||||
|
|
||||||
if (GC_G(gc_active)) {
|
if (GC_G(gc_active)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue