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

ruby-changes:46019

From: usa <ko1@a...>
Date: Sun, 26 Mar 2017 00:30:41 +0900 (JST)
Subject: [ruby-changes:46019] usa:r58090 (ruby_2_2): merge revision(s) 57368: [Backport #12613]

usa	2017-03-26 00:30:36 +0900 (Sun, 26 Mar 2017)

  New Revision: 58090

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

  Log:
    merge revision(s) 57368: [Backport #12613]
    
    compile.c: check err_info
    
    * compile.c (iseq_setup): bail out if any errors found.
      [ruby-core:76531] [Bug #12613]

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/compile.c
    branches/ruby_2_2/test/ruby/test_syntax.rb
    branches/ruby_2_2/version.h
Index: ruby_2_2/compile.c
===================================================================
--- ruby_2_2/compile.c	(revision 58089)
+++ ruby_2_2/compile.c	(revision 58090)
@@ -478,9 +478,6 @@ static void https://github.com/ruby/ruby/blob/trunk/ruby_2_2/compile.c#L478
 validate_labels(rb_iseq_t *iseq, st_table *labels_table)
 {
     st_foreach(labels_table, validate_label, (st_data_t)iseq);
-    if (!NIL_P(iseq->compile_data->err_info)) {
-	rb_exc_raise(iseq->compile_data->err_info);
-    }
 }
 
 VALUE
@@ -1046,6 +1043,10 @@ new_child_iseq(rb_iseq_t *iseq, NODE *no https://github.com/ruby/ruby/blob/trunk/ruby_2_2/compile.c#L1043
 static int
 iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
 {
+    if (!NIL_P(iseq->compile_data->err_info)) {
+	return COMPILE_NG;
+    }
+
     /* debugs("[compile step 2] (iseq_array_to_linkedlist)\n"); */
 
     if (compile_debug > 5)
Index: ruby_2_2/test/ruby/test_syntax.rb
===================================================================
--- ruby_2_2/test/ruby/test_syntax.rb	(revision 58089)
+++ ruby_2_2/test/ruby/test_syntax.rb	(revision 58090)
@@ -658,6 +658,23 @@ eom https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_syntax.rb#L658
     end
   end
 
+  def test_syntax_error_in_rescue
+    bug12613 = '[ruby-core:76531] [Bug #12613]'
+    assert_syntax_error("#{<<-"begin;"}\n#{<<-"end;"}", /Invalid retry/, bug12613)
+    begin;
+      while true
+        begin
+          p
+        rescue
+          retry
+        else
+          retry
+        end
+        break
+      end
+    end;
+  end
+
   private
 
   def not_label(x) @result = x; @not_label ||= nil end
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 58089)
+++ ruby_2_2/version.h	(revision 58090)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.7"
 #define RUBY_RELEASE_DATE "2017-03-26"
-#define RUBY_PATCHLEVEL 422
+#define RUBY_PATCHLEVEL 423
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 3

Property changes on: ruby_2_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r57368


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

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