shire Tue Dec 19 08:02:48 2006 UTC Modified files: /php-src/ext/standard array.c /php-src/ext/standard/tests/array bug30074.phpt Log: -Fixed bug #30074 (apparent symbol table error with extract($blah, EXTR_REFS)) # appoligies, I did this in reverse (applied to PHP_5_2) I should have MFH. http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.397&r2=1.398&diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.397 php-src/ext/standard/array.c:1.398 --- php-src/ext/standard/array.c:1.397 Wed Dec 6 17:42:47 2006 +++ php-src/ext/standard/array.c Tue Dec 19 08:02:48 2006 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.397 2006/12/06 17:42:47 tony2001 Exp $ */ +/* $Id: array.c,v 1.398 2006/12/19 08:02:48 shire Exp $ */ #include "php.h" #include "php_ini.h" @@ -1492,7 +1492,7 @@ *orig_var = *entry; } else { - if (var_array->refcount > 1) { + if (var_array->refcount > 1 || *entry == EG(uninitialized_zval_ptr)) { SEPARATE_ZVAL_TO_MAKE_IS_REF(entry); } else { (*entry)->is_ref = 1; http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/bug30074.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/standard/tests/array/bug30074.phpt diff -u /dev/null php-src/ext/standard/tests/array/bug30074.phpt:1.2 --- /dev/null Tue Dec 19 08:02:48 2006 +++ php-src/ext/standard/tests/array/bug30074.phpt Tue Dec 19 08:02:48 2006 @@ -0,0 +1,15 @@ +--TEST-- +Bug #30074 (EG(uninitialized_zval_ptr) gets set to reference using EXTR_REFS, affecting later values) +--FILE-- +<?php +error_reporting(E_ALL & ~E_NOTICE); // We don't want the notice for $undefined +$result = extract(array('a'=>$undefined), EXTR_REFS); +var_dump(array($a)); +echo "Done\n"; +?> +--EXPECT-- +array(1) { + [0]=> + NULL +} +Done
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php