summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-16 19:38:27 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-16 19:38:27 +0000
commitb3376c4df6bfd0407a53abf10bc5b7df07edfe89 (patch)
treeee88c5e514218b8b00f37198da0c5dc535e39f51
parent09edb78ff0548cba7a545b3fd579b1cdcd5a36be (diff)
* range.c (range_step): fixed integer overflow. [ruby-dev:31763]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--range.c5
-rw-r--r--version.h8
3 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 031b1d4..4a8ecbd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Sep 17 04:37:10 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * range.c (range_step): fixed integer overflow. [ruby-dev:31763]
+
Fri Sep 7 17:06:16 2007 Vincent Isambart <vincent.isambart@gmail.com>
* eval.c (rb_thread_start_0): should unset time_thread_alive_p.
diff --git a/range.c b/range.c
index 3f575de..568b24d 100644
--- a/range.c
+++ b/range.c
@@ -319,8 +319,11 @@ range_step(argc, argv, range)
if (unit == 0) rb_raise(rb_eArgError, "step can't be 0");
if (!EXCL(range)) end += 1;
- for (i=FIX2LONG(b); i<end; i+=unit) {
+ i = FIX2LONG(b);
+ while (i < end) {
rb_yield(LONG2NUM(i));
+ if (i + unit < i) break;
+ i += unit;
}
}
else {
diff --git a/version.h b/version.h
index c0881dc..fe3700c 100644
--- a/version.h
+++ b/version.h
@@ -1,15 +1,15 @@
#define RUBY_VERSION "1.8.6"
-#define RUBY_RELEASE_DATE "2007-09-07"
+#define RUBY_RELEASE_DATE "2007-09-17"
#define RUBY_VERSION_CODE 186
-#define RUBY_RELEASE_CODE 20070907
-#define RUBY_PATCHLEVEL 101
+#define RUBY_RELEASE_CODE 20070917
+#define RUBY_PATCHLEVEL 102
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 6
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 9
-#define RUBY_RELEASE_DAY 7
+#define RUBY_RELEASE_DAY 17
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];