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

ruby-changes:30110

From: ko1 <ko1@a...>
Date: Thu, 25 Jul 2013 16:20:11 +0900 (JST)
Subject: [ruby-changes:30110] ko1:r42162 (trunk): * encoding.c (check_encoding): Check T_DATA or not.

ko1	2013-07-25 16:19:59 +0900 (Thu, 25 Jul 2013)

  New Revision: 42162

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

  Log:
    * encoding.c (check_encoding): Check T_DATA or not.
      is_data_encoding(obj) assumes that `obj' is T_DATA.

  Modified files:
    trunk/ChangeLog
    trunk/encoding.c

Index: encoding.c
===================================================================
--- encoding.c	(revision 42161)
+++ encoding.c	(revision 42162)
@@ -121,7 +121,7 @@ check_encoding(rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/encoding.c#L121
 static int
 enc_check_encoding(VALUE obj)
 {
-    if (!is_data_encoding(obj)) {
+    if (!RB_TYPE_P(obj, T_DATA) || !is_data_encoding(obj)) {
 	return -1;
     }
     return check_encoding(RDATA(obj)->data);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42161)
+++ ChangeLog	(revision 42162)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jul 25 16:17:55 2013  Koichi Sasada  <ko1@a...>
+
+	* encoding.c (check_encoding): Check T_DATA or not.
+	  is_data_encoding(obj) assumes that `obj' is T_DATA.
+
 Thu Jul 25 13:06:46 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* dir.c (dir_s_home): use rb_home_dir_of and rb_default_home_dir.

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

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