Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

should check the argument

  • Loading branch information...
commit a2f9d4932697c6c5ff665ad4337620ba2f1ecc68 1 parent 851f216
@Watson1978 Watson1978 authored
View
1  class.c
@@ -779,6 +779,7 @@ rb_mod_included_modules(VALUE mod)
VALUE
rb_mod_include_p(VALUE mod, SEL sel, VALUE mod2)
{
+ Check_Type(mod2, T_MODULE);
return rb_ary_includes(rb_mod_included_modules(mod), mod2);
}
View
8 complex.c
@@ -1322,10 +1322,10 @@ static VALUE
nucomp_marshal_load(VALUE self, SEL sel, VALUE a)
{
get_dat1(self);
- VALUE ary = rb_convert_type(a, T_ARRAY, "Array", "to_ary");
- GC_WB(&dat->real, RARRAY_AT(ary, 0));
- GC_WB(&dat->imag, RARRAY_AT(ary, 1));
- rb_copy_generic_ivar(self, ary);
+ Check_Type(a, T_ARRAY);
+ GC_WB(&dat->real, RARRAY_AT(a, 0));
+ GC_WB(&dat->imag, RARRAY_AT(a, 1));
+ rb_copy_generic_ivar(self, a);
return self;
}
View
9 rational.c
@@ -1583,10 +1583,11 @@ static VALUE
nurat_marshal_load(VALUE self, SEL sel, VALUE a)
{
get_dat1(self);
- VALUE ary = rb_convert_type(a, T_ARRAY, "Array", "to_ary");
- GC_WB(&dat->num, RARRAY_AT(ary, 0));
- GC_WB(&dat->den, RARRAY_AT(ary ,1));
- rb_copy_generic_ivar(self, ary);
+ Check_Type(a, T_ARRAY);
+ GC_WB(&dat->num, RARRAY_AT(a, 0));
+ GC_WB(&dat->den, RARRAY_AT(a ,1));
+ rb_copy_generic_ivar(self, a);
+
if (f_zero_p(dat->den)) {
rb_raise_zerodiv();
}
View
1  spec/frozen/tags/macruby/core/module/include_tags.txt
@@ -2,4 +2,3 @@ fails:Module#include adds all ancestor modules when a previously included module
fails:Module#include doesn't include module if it is included in a super class
fails:Module#include recursively includes new mixins
fails:Module#include preserves ancestor order
-fails:Module#include? raises a TypeError when no module was given
Please sign in to comment.
Something went wrong with that request. Please try again.