diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-25 15:30:36 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-25 15:30:36 +0000 |
commit | a0f4f4369b4d5a04f163bfaa20c4360aba3cee29 (patch) | |
tree | b9729cfd4da7c3a2c4b28f6192c3311cb9afb18b | |
parent | d53acd8540e7370cc852222e7e53cb8e904d0cc3 (diff) |
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]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@58090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | compile.c | 7 | ||||
-rw-r--r-- | test/ruby/test_syntax.rb | 17 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 22 insertions, 4 deletions
@@ -478,9 +478,6 @@ static void 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 *node, 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) diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index f0502d37e4..fee5605b61 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -658,6 +658,23 @@ eom 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 @@ -1,6 +1,6 @@ #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 |