That last patch was the wrong file, based on an earlier version :-/
Here is the correct patch, which will raise a warning instead of a fatal
error, which at least gives the user the option of suppressing the problem
by using error_reporting().
--Wez.
Index: Zend/zend_hash.c
===================================================================
RCS file: /repository/Zend/zend_hash.c,v
retrieving revision 1.87
diff -u -r1.87 zend_hash.c
--- Zend/zend_hash.c 17 Aug 2002 16:06:50 -0000 1.87
+++ Zend/zend_hash.c 29 Sep 2002 12:20:57 -0000
@@ -111,6 +111,13 @@
}
\
}
+#define HASH_PROTECT_COMPARISON_RECURSION(ht)
+ \
+ if ((ht)->bApplyProtection) {
+ \
+ if ((ht)->nApplyCount++ >= 3) {
+ \
+ zend_error(E_WARNING, "Nesting level too deep - recursive
+dependency?"); \
+ return 1;
+ \
+ }
+ \
+ }
#define HASH_UNPROTECT_RECURSION(ht)
\
if ((ht)->bApplyProtection) {
\
@@ -1169,11 +1176,15 @@
int result;
void *pData2;
+ if (ht1 == ht2) {
+ return 0;
+ }
+
IS_CONSISTENT(ht1);
IS_CONSISTENT(ht2);
- HASH_PROTECT_RECURSION(ht1);
- HASH_PROTECT_RECURSION(ht2);
+ HASH_PROTECT_COMPARISON_RECURSION(ht1);
+ HASH_PROTECT_COMPARISON_RECURSION(ht2);
result = ht1->nNumOfElements - ht2->nNumOfElements;
if (result!=0) {
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php