diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-09 17:45:53 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-09 17:45:53 +0000 |
commit | 90a88ab9a09d19165cf3668b6a8473024e064fa7 (patch) | |
tree | e11fe4e2ab597cf512b2fd680b50c91cc0293a08 /bignum.c | |
parent | 80549d5f17e09173251204f08d288a71bad39256 (diff) |
* marshal.c (r_object0): remove unnecessary iv restoration for
USRMARSHAL. [ruby-dev:21582]
* marshal.c (w_object): dump generic instance variables from
a string from '_dump'.
* variable.c (rb_generic_ivar_table): return 0 if obj's FL_EXIVAR
is not set.
* time.c (time_dump): copy instance variables to dumped string, to
be included in the marshaled data.
* bignum.c (rb_big2ulong): add range check to ensure round trip.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -729,7 +729,12 @@ rb_big2ulong(x) { unsigned long num = big2ulong(x, "unsigned long"); - if (!RBIGNUM(x)->sign) return -num; + if (!RBIGNUM(x)->sign) { + if ((long)num < 0) { + rb_raise(rb_eRangeError, "bignum out of range of unsigned long"); + } + return -num; + } return num; } |