diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-08 10:10:28 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-08 10:10:28 +0000 |
commit | a7c32bf81d3391cfb78cfda278f469717d0fb794 (patch) | |
tree | 61b180f9a469615991e3bb05e1124fa67c4dbbe0 /error.c | |
parent | abbd115cae8f6db1bfe1c349ed6f928ac96c6622 (diff) | |
download | ruby-a7c32bf81d3391cfb78cfda278f469717d0fb794.tar.gz |
* 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
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |