summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-12 03:16:31 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-12 03:16:31 +0000
commitfc8e62d0df805059eb73cf4c6dd54db0210db084 (patch)
tree05cfac969865445eb7ddd74700ef60350d9a9e89 /bignum.c
parent20e165a04090a024db4d295d00af6ed1ac67578d (diff)
* bignum.c (rb_big_and): convert argument using 'to_int'.
* bignum.c (rb_big_or): ditto. * bignum.c (rb_big_xor): ditto. * eval.c (rb_f_require): allow "require" on $SAFE>0, if feature name is not tainted. * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::stream): Supports StringIO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/bignum.c b/bignum.c
index 550dcfcafe..6882580eae 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1451,13 +1451,10 @@ rb_big_and(x, y)
long i, l1, l2;
char sign;
+ y = rb_to_int(y);
if (FIXNUM_P(y)) {
y = rb_int2big(FIX2LONG(y));
}
- else {
- Check_Type(y, T_BIGNUM);
- }
-
if (!RBIGNUM(y)->sign) {
y = rb_big_clone(y);
get2comp(y, Qtrue);
@@ -1502,12 +1499,10 @@ rb_big_or(x, y)
long i, l1, l2;
char sign;
+ y = rb_to_int(y);
if (FIXNUM_P(y)) {
y = rb_int2big(FIX2LONG(y));
}
- else {
- Check_Type(y, T_BIGNUM);
- }
if (!RBIGNUM(y)->sign) {
y = rb_big_clone(y);
@@ -1554,12 +1549,10 @@ rb_big_xor(x, y)
long i, l1, l2;
char sign;
+ y = rb_to_int(y);
if (FIXNUM_P(y)) {
y = rb_int2big(FIX2LONG(y));
}
- else {
- Check_Type(y, T_BIGNUM);
- }
if (!RBIGNUM(y)->sign) {
y = rb_big_clone(y);