diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-10 08:30:09 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-10 08:30:09 +0000 |
commit | 5287eb7453f481dd1fed7b8561cd0b57771afaa9 (patch) | |
tree | 76ecc0a55f55da548afb2941432cf1ccf8613e1c | |
parent | ca75e7b97e4618681a8c27807dce44ae6724039e (diff) |
merge revision(s) 54893: [Backport #10763]
* parse.y (new_if_gen): set newline flag to NODE_IF to trace all
if/elsif statements. [ruby-core:67720] [Bug #10763]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@55360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | parse.y | 2 | ||||
-rw-r--r-- | test/ruby/test_settracefunc.rb | 19 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 26 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Fri Jun 10 16:30:16 2016 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * parse.y (new_if_gen): set newline flag to NODE_IF to trace all + if/elsif statements. [ruby-core:67720] [Bug #10763] + Fri Jun 10 16:24:29 2016 Marcus Stollsteimer <sto.mar@web.de> * ext/date/date_core.c (Init_date_core): [DOC] Convert DateTime @@ -3201,7 +3201,7 @@ if_tail : opt_else if_tail { /*%%%*/ - $$ = NEW_IF(cond($2), $4, $5); + $$ = NEW_IF(cond(newline_node($2)), $4, $5); fixpos($$, $2); /*% $$ = dispatch3(elsif, $2, $4, escape_Qundef($5)); diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index b09ed17ce8..277593516d 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -1401,6 +1401,25 @@ class TestSetTraceFunc < Test::Unit::TestCase assert_equal [__LINE__ - 3, __LINE__ - 2], lines, 'Bug #10449' end + def test_elsif_line_event + bug10763 = '[ruby-core:67720] [Bug #10763]' + lines = [] + line = nil + + TracePoint.new(:line){|tp| + next unless target_thread? + lines << tp.lineno if line + }.enable{ + line = __LINE__ + if !line + 1 + elsif line + 2 + end + } + assert_equal [line+1, line+3, line+4], lines, bug10763 + end + class Bug10724 def initialize loop{return} @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.2.6" #define RUBY_RELEASE_DATE "2016-06-10" -#define RUBY_PATCHLEVEL 334 +#define RUBY_PATCHLEVEL 335 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 6 |