[PHP-CVS] cvs: php-src /ext/standard string.c /ext/standard/tests/strings chunk_split_error.phpt chunk_split_variation5.phpt chunk_split_variation8.phpt htmlspecialchars_decode_variation2.phpt ZendE

2007-12-24 Thread Dmitry Stogov
dmitry  Mon Dec 24 18:10:20 2007 UTC

  Modified files:  
/ZendEngine2zend_operators.c 
/ZendEngine2/tests  int_overflow_64bit.phpt 
/php-src/ext/standard   string.c 
/php-src/ext/standard/tests/strings chunk_split_error.phpt 
chunk_split_variation5.phpt 
chunk_split_variation8.phpt 
htmlspecialchars_decode_variation2.phpt 
  Log:
  Additional fix for bug #42868
  
  http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.c?r1=1.285&r2=1.286&diff_format=u
Index: ZendEngine2/zend_operators.c
diff -u ZendEngine2/zend_operators.c:1.285 ZendEngine2/zend_operators.c:1.286
--- ZendEngine2/zend_operators.c:1.285  Mon Dec 17 11:06:42 2007
+++ ZendEngine2/zend_operators.cMon Dec 24 18:10:19 2007
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_operators.c,v 1.285 2007/12/17 11:06:42 dmitry Exp $ */
+/* $Id: zend_operators.c,v 1.286 2007/12/24 18:10:19 dmitry Exp $ */
 
 #include 
 
@@ -243,34 +243,35 @@
 #define MAX_UNSIGNED_INT ((double) LONG_MAX * 2) + 1
 #ifdef _WIN64
 # define DVAL_TO_LVAL(d, l) \
-if ((d) > LONG_MAX) { \
-if ((d) > MAX_UNSIGNED_INT) { \
-(l) = LONG_MAX; \
-} else { \
-(l) = (long)(unsigned long)(__int64) (d); \
-} \
-} else { \
-if((d) < LONG_MIN) { \
-(l) = LONG_MIN; \
-} else { \
-(l) = (long) (d); \
-} \
-}
+   if ((d) > LONG_MAX) { \
+   (l) = (long)(unsigned long)(__int64) (d); \
+   } else { \
+   (l) = (long) (d); \
+   }
+#elif !defined(_WIN64) && __WORDSIZE == 64
+# define DVAL_TO_LVAL(d, l) \
+   if ((d) >= LONG_MAX) { \
+   (l) = LONG_MAX; \
+   } else if ((d) <=  LONG_MIN) { \
+   (l) = LONG_MIN; \
+   } else {\
+   (l) = (long) (d); \
+   }
 #else
 # define DVAL_TO_LVAL(d, l) \
-if ((d) > LONG_MAX) { \
-if ((d) > MAX_UNSIGNED_INT) { \
-(l) = LONG_MAX; \
-} else { \
-(l) = (unsigned long) (d); \
-} \
-} else { \
-if((d) < LONG_MIN) { \
-(l) = LONG_MIN; \
-} else { \
-(l) = (long) (d); \
-} \
-}
+   if ((d) > LONG_MAX) { \
+   if ((d) > MAX_UNSIGNED_INT) { \
+   (l) = LONG_MAX; \
+   } else { \
+   (l) = (unsigned long) (d); \
+   } \
+   } else { \
+   if((d) < LONG_MIN) { \
+   (l) = LONG_MIN; \
+   } else { \
+   (l) = (long) (d); \
+   } \
+   }
 #endif
 /* }}} */
 
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/int_overflow_64bit.phpt?r1=1.2&r2=1.3&diff_format=u
Index: ZendEngine2/tests/int_overflow_64bit.phpt
diff -u ZendEngine2/tests/int_overflow_64bit.phpt:1.2 
ZendEngine2/tests/int_overflow_64bit.phpt:1.3
--- ZendEngine2/tests/int_overflow_64bit.phpt:1.2   Thu Sep 28 12:08:44 2006
+++ ZendEngine2/tests/int_overflow_64bit.phpt   Mon Dec 24 18:10:19 2007
@@ -6,11 +6,13 @@
 
 --EXPECTF--
-int(-9223372036854775808)
-int(-9223372036854775808)
+int(9223372036854775807)
+int(9223372036854775807)
+int(9223372036854775807)
+int(9223372036854775807)
 int(-9223372036854775808)
 int(-9223372036854775808)
 int(-9223372036854775808)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.657&r2=1.658&diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.657 php-src/ext/standard/string.c:1.658
--- php-src/ext/standard/string.c:1.657 Thu Dec 13 22:29:15 2007
+++ php-src/ext/standard/string.c   Mon Dec 24 18:10:19 2007
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.657 2007/12/13 22:29:15 tony2001 Exp $ */
+/* $Id: string.c,v 1.658 2007/12/24 18:10:19 dmitry Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -3339,7 +3339,7 @@
zstr result;
char *end= "\r\n";
UChar u_end[3] = { 0x0d, 0x0a, 0x0 };
-   int chunklen = 76;
+   long chunklen = 76;
int result_len;
zend_uchar str_type;
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/chunk_split_error.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/standard/tests/strings/chunk_split_error.phpt
diff -u php-src/ext/standard/tests/strings/chunk_split_error.phpt:1.2 
php-src/ext/standard/tests/strings/chunk_split_error.phpt:1.3
--- php-src/ext/standard/tests/strings/chunk_split_error.phpt:1.2   Sat Sep 
29 12:57:0

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard string.c /ext/standard/tests/strings chunk_split_error.phpt chunk_split_variation5.phpt chunk_split_variation8.phpt htmlspecialchars_decode_variation2.ph

2007-12-24 Thread Dmitry Stogov
dmitry  Mon Dec 24 18:09:50 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/ZendEngine2zend_operators.c 
/ZendEngine2/tests  int_overflow_64bit.phpt 
/php-src/ext/standard   string.c 
/php-src/ext/standard/tests/strings chunk_split_error.phpt 
chunk_split_variation5.phpt 
chunk_split_variation8.phpt 
htmlspecialchars_decode_variation2.phpt 
  Log:
  Additional fix for bug #42868
  
  http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.c?r1=1.208.2.4.2.23.2.4&r2=1.208.2.4.2.23.2.5&diff_format=u
Index: ZendEngine2/zend_operators.c
diff -u ZendEngine2/zend_operators.c:1.208.2.4.2.23.2.4 
ZendEngine2/zend_operators.c:1.208.2.4.2.23.2.5
--- ZendEngine2/zend_operators.c:1.208.2.4.2.23.2.4 Mon Dec 17 10:02:13 2007
+++ ZendEngine2/zend_operators.cMon Dec 24 18:09:50 2007
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_operators.c,v 1.208.2.4.2.23.2.4 2007/12/17 10:02:13 dmitry Exp $ 
*/
+/* $Id: zend_operators.c,v 1.208.2.4.2.23.2.5 2007/12/24 18:09:50 dmitry Exp $ 
*/
 
 #include 
 
@@ -186,36 +186,38 @@
 #define MAX_UNSIGNED_INT ((double) LONG_MAX * 2) + 1
 #ifdef _WIN64
 # define DVAL_TO_LVAL(d, l) \
-if ((d) > LONG_MAX) { \
-if ((d) > MAX_UNSIGNED_INT) { \
-(l) = LONG_MAX; \
-} else { \
-(l) = (long)(unsigned long)(__int64) (d); \
-} \
-} else { \
-if((d) < LONG_MIN) { \
-(l) = LONG_MIN; \
-} else { \
-(l) = (long) (d); \
-} \
-}
+   if ((d) > LONG_MAX) { \
+   (l) = (long)(unsigned long)(__int64) (d); \
+   } else { \
+   (l) = (long) (d); \
+   }
+#elif !defined(_WIN64) && __WORDSIZE == 64
+# define DVAL_TO_LVAL(d, l) \
+   if ((d) >= LONG_MAX) { \
+   (l) = LONG_MAX; \
+   } else if ((d) <=  LONG_MIN) { \
+   (l) = LONG_MIN; \
+   } else {\
+   (l) = (long) (d); \
+   } 
 #else
 # define DVAL_TO_LVAL(d, l) \
-if ((d) > LONG_MAX) { \
-if ((d) > MAX_UNSIGNED_INT) { \
-(l) = LONG_MAX; \
-} else { \
-(l) = (unsigned long) (d); \
-} \
-} else { \
-if((d) < LONG_MIN) { \
-(l) = LONG_MIN; \
-} else { \
-(l) = (long) (d); \
-} \
-}
+   if ((d) > LONG_MAX) { \
+   if ((d) > MAX_UNSIGNED_INT) { \
+   (l) = LONG_MAX; \
+   } else { \
+   (l) = (unsigned long) (d); \
+   } \
+   } else { \
+   if((d) < LONG_MIN) { \
+   (l) = LONG_MIN; \
+   } else { \
+   (l) = (long) (d); \
+   } \
+   } 
 #endif
 
+
 #define zendi_convert_to_long(op, holder, result)  
\
if (op == result) { 
\
convert_to_long(op);
\
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/int_overflow_64bit.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u
Index: ZendEngine2/tests/int_overflow_64bit.phpt
diff -u ZendEngine2/tests/int_overflow_64bit.phpt:1.1.2.1 
ZendEngine2/tests/int_overflow_64bit.phpt:1.1.2.1.2.1
--- ZendEngine2/tests/int_overflow_64bit.phpt:1.1.2.1   Thu Sep 28 12:03:49 2006
+++ ZendEngine2/tests/int_overflow_64bit.phpt   Mon Dec 24 18:09:50 2007
@@ -6,11 +6,13 @@
 
 --EXPECTF--
-int(-9223372036854775808)
-int(-9223372036854775808)
+int(9223372036854775807)
+int(9223372036854775807)
+int(9223372036854775807)
+int(9223372036854775807)
 int(-9223372036854775808)
 int(-9223372036854775808)
 int(-9223372036854775808)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.69.2.6&r2=1.445.2.14.2.69.2.7&diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.69.2.6 
php-src/ext/standard/string.c:1.445.2.14.2.69.2.7
--- php-src/ext/standard/string.c:1.445.2.14.2.69.2.6   Thu Dec 13 22:29:48 2007
+++ php-src/ext/standard/string.c   Mon Dec 24 18:09:50 2007
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.445.2.14.2.69.2.6 2007/12/13 22:29:48 tony2001 Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.69.2.7 2007/12/24 18:09:50 dmitry Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -2182,12 +2182,12 @@
char *result;
char *end= "\r\n

Re: [PHP-CVS] cvs: php-src / run-tests.php

2007-12-24 Thread Nuno Lopes

@@ -1600,7 +1600,7 @@
 $wanted_re = str_replace('%i', '[+-]?\d+', $wanted_re);
 $wanted_re = str_replace('%d', '\d+', $wanted_re);
 $wanted_re = str_replace('%x', '[0-9a-fA-F]+', $wanted_re);
- $wanted_re = str_replace('%f', '[+-]?\.?\d+\.?\d*(?:E[+-]?\d+)?', 
$wanted_re);
+ $wanted_re = str_replace('%f', '[+-]?\.?\d+\.?\d*(?:E|e[+-]?\d+)?', 
$wanted_re);

 $wanted_re = str_replace('%c', '.', $wanted_re);
 // %f allows two points "-.0.0" but that is the best *simple* expression



Please use [Ee] there instead of E|e. That is much more intuitive on what 
it'll match.
Nuno 


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php