[前][次][番号順一覧][スレッド一覧]

ruby-changes:12298

From: nobu <ko1@a...>
Date: Wed, 8 Jul 2009 19:10:46 +0900 (JST)
Subject: [ruby-changes:12298] Ruby:r23992 (trunk): * error.c (rb_check_type): rejects typed data.

nobu	2009-07-08 19:10:28 +0900 (Wed, 08 Jul 2009)

  New Revision: 23992

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23992

  Log:
    * error.c (rb_check_type): rejects typed data.

  Modified files:
    trunk/ChangeLog
    trunk/error.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 23991)
+++ ChangeLog	(revision 23992)
@@ -1,3 +1,7 @@
+Wed Jul  8 19:10:22 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* error.c (rb_check_type): rejects typed data.
+
 Wed Jul  8 18:28:04 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* proc.c ({proc,binding,method}_data_type): typed.
Index: error.c
===================================================================
--- error.c	(revision 23991)
+++ error.c	(revision 23992)
@@ -282,12 +282,14 @@
     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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]