From a7c32bf81d3391cfb78cfda278f469717d0fb794 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 8 Jul 2009 10:10:28 +0000 Subject: [PATCH] * error.c (rb_check_type): rejects typed data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ error.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 54d3067c8d..e83b5a7046 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Jul 8 19:10:22 2009 Nobuyoshi Nakada + + * error.c (rb_check_type): rejects typed data. + Wed Jul 8 18:28:04 2009 Nobuyoshi Nakada * proc.c ({proc,binding,method}_data_type): typed. diff --git a/error.c b/error.c index c3738db856..c4f4938cc6 100644 --- a/error.c +++ b/error.c @@ -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;