cvs: php-src /ext/standard array.c
| From: | Moriyoshi Koizumi | Date: | Tue, 10 Aug 2004 06:00:30 +0000 |
| Subject: | cvs: php-src /ext/standard array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-28241@lists.php.net to get a copy of this message | ||
moriyoshi Tue Aug 10 02:00:30 2004 EDT
Modified files:
/php-src/ext/standard array.c
Log:
- Bugfix #29493 (extract(array, EXTR_REFS) misbehaves with elements referred
twice or more times). (Patch inspired by Michael Manley. Thanks.)
http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.270&r2=1.271&ty=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.270 php-src/ext/standard/array.c:1.271
--- php-src/ext/standard/array.c:1.270 Wed Jul 28 20:35:07 2004
+++ php-src/ext/standard/array.c Tue Aug 10 02:00:30 2004
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.270 2004/07/29 00:35:07 iliaa Exp $ */
+/* $Id: array.c,v 1.271 2004/08/10 06:00:30 moriyoshi Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -1377,13 +1377,16 @@
if (extract_refs) {
zval **orig_var;
- SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
- zval_add_ref(entry);
-
if (zend_hash_find(EG(active_symbol_table), final_name.c, final_name.len+1, (void **)
&orig_var) == SUCCESS) {
zval_ptr_dtor(orig_var);
+
+ SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
+ zval_add_ref(entry);
+
*orig_var = *entry;
} else {
+ (*entry)->is_ref = 1;
+ zval_add_ref(entry);
zend_hash_update(EG(active_symbol_table), final_name.c, final_name.len+1, (void **) entry,
sizeof(zval *), NULL);
}
} else {