diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-07 07:06:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-07 07:06:32 +0000 |
commit | 71877c4b990b4671b858e1502a043423a513876c (patch) | |
tree | 11eae1ed1c5591818ad3a3a8569ba6e75587b701 /include/ruby | |
parent | 9a2a94b95b6ef2c86ec3e1b1e624e8404d998bd4 (diff) | |
download | ruby-71877c4b990b4671b858e1502a043423a513876c.tar.gz ruby-71877c4b990b4671b858e1502a043423a513876c.tar.xz ruby-71877c4b990b4671b858e1502a043423a513876c.zip |
* include/ruby/ruby.h (rb_long2int): evalates the argument only
once.
* struct.c (rb_struct_alloc): check array length overflow.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
-rw-r--r-- | include/ruby/ruby.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 8fc1eb0f0..33a35ce43 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -653,7 +653,7 @@ NORETURN(void rb_out_of_int(SIGNED_VALUE num)); int i = (int)(n); \ if ((long)i != (n)) rb_out_of_int(n) #ifdef __GNUC__ -#define rb_long2int(i2l_n) __extension__ ({rb_long2int_internal(i2l_n, i2l_i); i2l_i;}) +#define rb_long2int(n) __extension__ ({long i2l_n = (n); rb_long2int_internal(i2l_n, i2l_i); i2l_i;}) #else static inline int rb_long2int(long n) {rb_long2int_internal(n, i); return i;} |