cvs: ZendEngine2(PHP_5_2) / zend_hash.c /tests bug37715.phpt bug41372.phpt php-src NEWS
| From: | Dmitry Stogov | Date: | Tue, 24 Jul 2007 18:28:39 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_2) / zend_hash.c /tests bug37715.phpt bug41372.phpt php-src NEWS | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-5922@lists.php.net to get a copy of this message | ||
dmitry Tue Jul 24 18:28:39 2007 UTC
Added files: (Branch: PHP_5_2)
/ZendEngine2/tests bug37715.phpt bug41372.phpt
Modified files:
/php-src NEWS
/ZendEngine2 zend_hash.c
Log:
Fixed bug #41372 (Internal pointer of source array resets during array copying)
Fixed bug #37715 (array pointers resetting on copy)
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.853&r2=1.2027.2.547.2.854&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.853 php-src/NEWS:1.2027.2.547.2.854
--- php-src/NEWS:1.2027.2.547.2.853 Tue Jul 24 14:24:44 2007
+++ php-src/NEWS Tue Jul 24 18:28:38 2007
@@ -162,6 +162,8 @@
integer as sections). (Tony)
- Fixed bug #41433 (DBA: configure fails to include correct db.h for db4).
(Jani)
+- Fixed bug #41372 (Internal pointer of source array resets during array
+ copying). (Dmitry)
- Fixed bug #41350 (my_thread_global_end() error during request shutdown
on Windows). (Scott, Andrey)
- Fixed bug #41127 (Memory leak in ldap_{first|next}_attribute functions).
@@ -172,6 +174,7 @@
apache child die). (isk at ecommerce dot com, Gopal, Tony)
- Fixed bug #39291 (ldap_sasl_bind() misses the sasl_authc_id parameter).
(diafour at gmail dot com, Jani)
+- Fixed bug #37715 (array pointers resetting on copy). (Dmitry)
- Fixed bugs #36796, #36918, #41371 (stream_set_blocking() does not work).
(Jani)
- Fixed bug #35981 (pdo-pgsql should not use pkg-config when not present).
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_hash.c?r1=1.121.2.4.2.7&r2=1.121.2.4.2.8&diff_format=u
Index: ZendEngine2/zend_hash.c
diff -u ZendEngine2/zend_hash.c:1.121.2.4.2.7 ZendEngine2/zend_hash.c:1.121.2.4.2.8
--- ZendEngine2/zend_hash.c:1.121.2.4.2.7 Wed Feb 21 14:11:00 2007
+++ ZendEngine2/zend_hash.c Tue Jul 24 18:28:39 2007
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_hash.c,v 1.121.2.4.2.7 2007/02/21 14:11:00 dmitry Exp $ */
+/* $Id: zend_hash.c,v 1.121.2.4.2.8 2007/07/24 18:28:39 dmitry Exp $ */
#include "zend.h"
@@ -771,12 +771,17 @@
{
Bucket *p;
void *new_entry;
+ zend_bool setTargetPointer;
IS_CONSISTENT(source);
IS_CONSISTENT(target);
+ setTargetPointer = !target->pInternalPointer;
p = source->pListHead;
while (p) {
+ if (setTargetPointer && source->pInternalPointer == p) {
+ target->pInternalPointer = NULL;
+ }
if (p->nKeyLength) {
zend_hash_quick_update(target, p->arKey, p->nKeyLength, p->h, p->pData, size,
&new_entry);
} else {
@@ -787,7 +792,9 @@
}
p = p->pListNext;
}
- target->pInternalPointer = target->pListHead;
+ if (!target->pInternalPointer) {
+ target->pInternalPointer = target->pListHead;
+ }
}
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug37715.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug37715.phpt
+++ ZendEngine2/tests/bug37715.phpt
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug41372.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug41372.phpt
+++ ZendEngine2/tests/bug41372.phpt