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

ruby-changes:39966

From: nobu <ko1@a...>
Date: Tue, 6 Oct 2015 02:29:09 +0900 (JST)
Subject: [ruby-changes:39966] nobu:r52047 (trunk): compile.c: dstr head type

nobu	2015-10-06 02:29:04 +0900 (Tue, 06 Oct 2015)

  New Revision: 52047

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

  Log:
    compile.c: dstr head type
    
    * compile.c (compile_dstr_fragments): head of dstr must be a
      string.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 52046)
+++ compile.c	(revision 52047)
@@ -2341,8 +2341,11 @@ compile_dstr_fragments(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/compile.c#L2341
     debugp_param("nd_lit", lit);
     if (!NIL_P(lit)) {
 	cnt++;
-	if (RB_TYPE_P(lit, T_STRING))
-	    lit = node->nd_lit = rb_fstring(node->nd_lit);
+	if (!RB_TYPE_P(lit, T_STRING)) {
+	    rb_compile_bug(ERROR_ARGS "dstr: must be string: %s",
+			   rb_builtin_type_name(TYPE(lit)));
+	}
+	lit = node->nd_lit = rb_fstring(lit);
 	ADD_INSN1(ret, nd_line(node), putobject, lit);
 	if (RSTRING_LEN(lit) == 0) first_lit = LAST_ELEMENT(ret);
     }

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

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