diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | error.c | 4 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Wed Jul 8 19:10:22 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * error.c (rb_check_type): rejects typed data. + Wed Jul 8 18:28:04 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * proc.c ({proc,binding,method}_data_type): typed. @@ -282,12 +282,14 @@ rb_check_type(VALUE x, int t) const struct types *type = builtin_types; const struct types *const typeend = builtin_types + sizeof(builtin_types) / sizeof(builtin_types[0]); + int xt; if (x == Qundef) { rb_bug("undef leaked to the Ruby space"); } - if (TYPE(x) != t) { + xt = TYPE(x); + if (xt != t || (xt == T_DATA && RTYPEDDATA_P(x))) { while (type < typeend) { if (type->type == t) { const char *etype; |