iliaa           Thu Apr 19 23:21:22 2007 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/standard/tests/array   bug41121.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/standard       array.c 
  Log:
  Fixed bug #41121 (range() overflow handling for large numbers on 32bit
  machines).
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.654&r2=1.2027.2.547.2.655&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.654 php-src/NEWS:1.2027.2.547.2.655
--- php-src/NEWS:1.2027.2.547.2.654     Wed Apr 18 22:53:45 2007
+++ php-src/NEWS        Thu Apr 19 23:21:21 2007
@@ -2,6 +2,8 @@
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? Apr 2007, PHP 5.2.2RC2
 - Upgraded SQLite 3 to version 3.3.16 (Ilia)
+- Fixed bug #41121 (range() overflow handling for large numbers on 32bit
+  machines). (Ilia)
 - Fixed bug #41109 (recursiveiterator.inc says "implements" Iterator instead of
   "extends"). (Marcus)
 - Fixed bug #41093 (magic_quotes_gpc ignores first arrays keys). (Arpad, Ilia)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.26&r2=1.308.2.21.2.27&diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.26 
php-src/ext/standard/array.c:1.308.2.21.2.27
--- php-src/ext/standard/array.c:1.308.2.21.2.26        Sun Mar 18 20:20:23 2007
+++ php-src/ext/standard/array.c        Thu Apr 19 23:21:21 2007
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: array.c,v 1.308.2.21.2.26 2007/03/18 20:20:23 wez Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.27 2007/04/19 23:21:21 iliaa Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -1718,13 +1718,13 @@
                        add_next_index_double(return_value, low);
                }
        } else {
-               int low, high;
+               double low, high;
                long lstep;
 long_str:
-               convert_to_long(zlow);
-               convert_to_long(zhigh);
-               low = Z_LVAL_P(zlow);
-               high = Z_LVAL_P(zhigh);
+               convert_to_double(zlow);
+               convert_to_double(zhigh);
+               low = Z_DVAL_P(zlow);
+               high = Z_DVAL_P(zhigh);
                lstep = (long) step;
                                
                if (low > high) {               /* Negative steps */
@@ -1733,18 +1733,18 @@
                                goto err;
                        }
                        for (; low >= high; low -= lstep) {
-                               add_next_index_long(return_value, low);
+                               add_next_index_long(return_value, (long)low);
                        }       
-               } else if (high > low) {        /* Positive steps */
+               } else if (high > low) {        /* Positive steps */
                        if (high - low < lstep || lstep <= 0) {
                                err = 1;
                                goto err;
                        }
                        for (; low <= high; low += lstep) {
-                               add_next_index_long(return_value, low);
+                               add_next_index_long(return_value, (long)low);
                        }       
                } else {
-                       add_next_index_long(return_value, low);
+                       add_next_index_long(return_value, (long)low);
                }
        }
 err:

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/bug41121.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/bug41121.phpt
+++ php-src/ext/standard/tests/array/bug41121.phpt

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

Reply via email to