Skip to content

Commit

Permalink
* range.c (range_step): fixed integer overflow. [ruby-dev:31763]
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
shyouhei committed Sep 16, 2007
1 parent 09edb78 commit b3376c4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions 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.
Expand Down
5 changes: 4 additions & 1 deletion range.c
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions 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[];
Expand Down

0 comments on commit b3376c4

Please sign in to comment.