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

ruby-changes:46945

From: nobu <ko1@a...>
Date: Sun, 11 Jun 2017 20:21:07 +0900 (JST)
Subject: [ruby-changes:46945] nobu:r59060 (trunk): expand ruby_sourcefile

nobu	2017-06-11 20:21:01 +0900 (Sun, 11 Jun 2017)

  New Revision: 59060

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

  Log:
    expand ruby_sourcefile
    
    * compile.c: expand ruby_sourcefile not to evaluate twice in
      RSTRING_PTR.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 59059)
+++ compile.c	(revision 59060)
@@ -529,8 +529,6 @@ iseq_add_mark_object(const rb_iseq_t *is https://github.com/ruby/ruby/blob/trunk/compile.c#L529
     return COMPILE_OK;
 }
 
-#define ruby_sourcefile		RSTRING_PTR(rb_iseq_path(iseq))
-
 static int
 iseq_add_mark_object_compile_time(const rb_iseq_t *iseq, VALUE v)
 {
@@ -3250,7 +3248,8 @@ when_vals(rb_iseq_t *iseq, LINK_ANCHOR * https://github.com/ruby/ruby/blob/trunk/compile.c#L3248
 	}
 	else {
 	    if (rb_hash_lookup(literals, lit) != Qnil) {
-		rb_compile_warning(ruby_sourcefile, nd_line(val),
+		VALUE file = rb_iseq_path(iseq);
+		rb_compile_warning(RSTRING_PTR(file), nd_line(val),
 				   "duplicated when clause is ignored");
 	    }
 	    else {

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

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