
Issue #20814 has been updated by nobu (Nobuyoshi Nakada). Description updated hurricup (Alexandr Evstigneev) wrote:
ruby 3.4-preview2 seems optimizes out some stuff when building iseq and this may lead to user unexpected behavior when debugging, because some lines just optimized out.
Example: ``` def foo1 if true nil else 1 end end ```
produces: ``` == disasm: #<ISeq:foo1@/test.rb:1 (1,0)-(7,3)> 0000 putnil ( 3)[LiCa] 0001 leave ( 7)[Re] ```
Two questions: - is there way to disable such optimizations? - are there some specs on things that can be optimized.
---------------------------------------- Misc #20814: iseq optimizations on constant condition https://bugs.ruby-lang.org/issues/20814#change-110239 * Author: hurricup (Alexandr Evstigneev) * Status: Feedback ---------------------------------------- ruby 3.4-preview2 seems optimizes out some stuff when building iseq and this may lead to user unexpected behavior when debugging, because some lines just optimized out. Example: ```ruby def foo1 if true nil else 1 end end ``` produces: ``` == disasm: #<ISeq:foo1@/test.rb:1 (1,0)-(7,3)> 0000 putnil ( 3)[LiCa] 0001 leave ( 7)[Re] ``` Two questions: - is there way to disable such optimizations? - are there some specs on things that can be optimized. -- https://bugs.ruby-lang.org/