[ruby-cvs:71985] nagachika:r64893 (ruby_2_5): merge revision(s) 63868, 63870: [Backport #14897]

nagachika at ruby-lang.org nagachika at ruby-lang.org
Mon Oct 1 21:02:17 JST 2018


nagachika	2018-10-01 21:02:17 +0900 (Mon, 01 Oct 2018)

  New Revision: 64893

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

  Log:
    merge revision(s) 63868,63870: [Backport #14897]
    
    Fix a bug of peephole optimization
    
    ```
      if   L1
    L0:
      jump L2
    L1:
      ...
    L2:
    ```
    
    was wrongly optimized to:
    
    ```
      unless L2
    L0:
    L1:
      ...
    L2:
    ```
    
    To make it conservative, this optimization is now disabled when there is
    any label between `if` and `jump` instructions.
    Fixes [Bug #14897].
    
    compile.c: remove unreachable jump only
    
    * compile.c (iseq_peephole_optimize): remove unreachable jump
      instruction only.  if it is labeled and referred from other
      instructions, it is reachable and must not be removed.
      [ruby-core:87830] [Bug #14897]

  Modified directories:
    branches/ruby_2_5/
  Modified files:
    branches/ruby_2_5/bootstraptest/test_flow.rb
    branches/ruby_2_5/compile.c
    branches/ruby_2_5/test/ruby/test_optimization.rb
    branches/ruby_2_5/version.h


More information about the ruby-cvs mailing list