[ruby-core:121605] [Ruby Bug#21259] The Prism compiler wrongly creates a line number of zero

Issue #21259 has been reported by mame (Yusuke Endoh). ---------------------------------------- Bug #21259: The Prism compiler wrongly creates a line number of zero https://bugs.ruby-lang.org/issues/21259 * Author: mame (Yusuke Endoh) * Status: Assigned * Assignee: prism * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- test.rb ``` TracePoint.new(:line) do |tp| p tp end.enable load "./target.rb" ``` target.rb ``` if true..true end ``` ``` $ ~/work/ruby/local/bin/ruby --parser=prism test.rb #<TracePoint:line test.rb:5> #<TracePoint:line /tmp/reproduce-simplecov-ruby34-bug/target.rb:0> # <=== This lineno should be 1 $ ~/work/ruby/local/bin/ruby --parser=parse.y test.rb #<TracePoint:line test.rb:5> #<TracePoint:line /tmp/reproduce-simplecov-ruby34-bug/target.rb:1> ``` -- https://bugs.ruby-lang.org/

Issue #21259 has been updated by tenderlovemaking (Aaron Patterson). Status changed from Assigned to Closed Backport changed from 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN to 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: REQUIRED Fixed in 148db9c80f11af1780f0f3685201f28de8f6b47a ---------------------------------------- Bug #21259: The Prism compiler wrongly creates a line number of zero https://bugs.ruby-lang.org/issues/21259#change-114095 * Author: mame (Yusuke Endoh) * Status: Closed * Assignee: prism * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: REQUIRED ---------------------------------------- test.rb ``` TracePoint.new(:line) do |tp| p tp end.enable load "./target.rb" ``` target.rb ``` if true..true end ``` ``` $ ~/work/ruby/local/bin/ruby --parser=prism test.rb #<TracePoint:line test.rb:5> #<TracePoint:line /tmp/reproduce-simplecov-ruby34-bug/target.rb:0> # <=== This lineno should be 1 $ ~/work/ruby/local/bin/ruby --parser=parse.y test.rb #<TracePoint:line test.rb:5> #<TracePoint:line /tmp/reproduce-simplecov-ruby34-bug/target.rb:1> ``` -- https://bugs.ruby-lang.org/

Issue #21259 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: REQUIRED to 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: DONE ruby_3_4 commit:8b505a286080fead52a603fcd2761c2d6b3e3aec merged revision(s) commit:148db9c80f11af1780f0f3685201f28de8f6b47a. ---------------------------------------- Bug #21259: The Prism compiler wrongly creates a line number of zero https://bugs.ruby-lang.org/issues/21259#change-114123 * Author: mame (Yusuke Endoh) * Status: Closed * Assignee: prism * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: DONE ---------------------------------------- test.rb ``` TracePoint.new(:line) do |tp| p tp end.enable load "./target.rb" ``` target.rb ``` if true..true end ``` ``` $ ~/work/ruby/local/bin/ruby --parser=prism test.rb #<TracePoint:line test.rb:5> #<TracePoint:line /tmp/reproduce-simplecov-ruby34-bug/target.rb:0> # <=== This lineno should be 1 $ ~/work/ruby/local/bin/ruby --parser=parse.y test.rb #<TracePoint:line test.rb:5> #<TracePoint:line /tmp/reproduce-simplecov-ruby34-bug/target.rb:1> ``` -- https://bugs.ruby-lang.org/
participants (3)
-
k0kubun (Takashi Kokubun)
-
mame (Yusuke Endoh)
-
tenderlovemaking (Aaron Patterson)