cvs: php4 /ext/standard array.c
| From: | Zeev Suraski | Date: | Fri, 01 Mar 2002 12:00:05 +0000 |
| Subject: | cvs: php4 /ext/standard array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9542@lists.php.net to get a copy of this message | ||
zeev Fri Mar 1 07:00:05 2002 EDT
Modified files:
/php4/ext/standard array.c
Log:
Fix php_splice() to work with large values
Index: php4/ext/standard/array.c
diff -u php4/ext/standard/array.c:1.156 php4/ext/standard/array.c:1.157
--- php4/ext/standard/array.c:1.156 Tue Feb 5 15:43:48 2002
+++ php4/ext/standard/array.c Fri Mar 1 07:00:05 2002
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.156 2002/02/05 20:43:48 andi Exp $ */
+/* $Id: array.c,v 1.157 2002/03/01 12:00:05 zeev Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -1529,7 +1529,17 @@
and copy it into the output hash */
for (i=0; i<list_count; i++) {
entry = *list[i];
- entry->refcount++;
+ if (entry->refcount>=1000) {
+ zval *tmp = (zval *) emalloc(sizeof(zval));
+
+ *tmp = *entry;
+ zval_copy_ctor(tmp);
+ tmp->refcount = 1;
+ tmp->is_ref = 0;
+ entry = tmp;
+ } else {
+ entry->refcount++;
+ }
zend_hash_next_index_insert(out_hash, &entry, sizeof(zval *), NULL);
}
}