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

ruby-changes:40879

From: nobu <ko1@a...>
Date: Tue, 8 Dec 2015 23:47:51 +0900 (JST)
Subject: [ruby-changes:40879] nobu:r52958 (trunk): compile.c: make opt a string value

nobu	2015-12-08 23:47:38 +0900 (Tue, 08 Dec 2015)

  New Revision: 52958

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

  Log:
    compile.c: make opt a string value
    
    * compile.c (iseq_ibf_dump): rb_check_string_type() returns nil if
      the object does not have to_str method.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 52957)
+++ compile.c	(revision 52958)
@@ -8064,9 +8064,10 @@ iseq_ibf_dump(const rb_iseq_t *iseq, VAL https://github.com/ruby/ruby/blob/trunk/compile.c#L8064
     header.size = ibf_dump_pos(&dump);
 
     if (RTEST(opt)) {
-	VALUE opt_str = rb_check_string_type(opt);
+	VALUE opt_str = opt;
+	const char *ptr = StringValuePtr(opt_str);
 	header.extra_size = RSTRING_LENINT(opt_str) + 1;
-	ibf_dump_write(&dump, RSTRING_PTR(opt_str), header.extra_size);
+	ibf_dump_write(&dump, ptr, header.extra_size);
     }
     else {
 	header.extra_size = 0;

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

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