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

ruby-changes:50303

From: nobu <ko1@a...>
Date: Fri, 16 Feb 2018 10:15:39 +0900 (JST)
Subject: [ruby-changes:50303] nobu:r62418 (trunk): compile.c: keep debug info

nobu	2018-02-16 10:15:35 +0900 (Fri, 16 Feb 2018)

  New Revision: 62418

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

  Log:
    compile.c: keep debug info
    
    * compile.c (iseq_peephole_optimize): keep freezestring insn
      with debug info.  [Bug #14475]

  Modified files:
    trunk/compile.c
    trunk/test/ruby/test_rubyoptions.rb
Index: compile.c
===================================================================
--- compile.c	(revision 62417)
+++ compile.c	(revision 62418)
@@ -2846,11 +2846,12 @@ iseq_peephole_optimize(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/compile.c#L2846
     }
 
     if (IS_INSN_ID(iobj, freezestring) &&
+	NIL_P(OPERAND_AT(iobj, 0)) &&
 	IS_NEXT_INSN_ID(&iobj->link, send)) {
 	INSN *niobj = (INSN *)iobj->link.next;
 	struct rb_call_info *ci = (struct rb_call_info *)OPERAND_AT(niobj, 0);
 	/*
-	 *  freezestring debug_info
+	 *  freezestring nil # no debug_info
 	 *  send <:+@, 0, ARG_SIMPLE>  # :-@, too
 	 * =>
 	 *  send <:+@, 0, ARG_SIMPLE>  # :-@, too
Index: test/ruby/test_rubyoptions.rb
===================================================================
--- test/ruby/test_rubyoptions.rb	(revision 62417)
+++ test/ruby/test_rubyoptions.rb	(revision 62418)
@@ -947,6 +947,8 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L947
       [
         ['"foo" << "bar"', err],
         ['"foo#{123}bar" << "bar"', err],
+        ['+"foo#{123}bar" << "bar"', []],
+        ['-"foo#{123}bar" << "bar"', freeze && debug ? with_debug_pat : wo_debug_pat],
       ].each do |code, expected|
         assert_in_out_err(opt, code, [], expected, [opt, code])
       end

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

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