[ruby-cvs:67905] ko1:r60724 (trunk): fix peephole optimization.

ko1 at ruby-lang.org ko1 at ruby-lang.org
Thu Nov 9 13:27:27 JST 2017


ko1	2017-11-09 13:27:27 +0900 (Thu, 09 Nov 2017)

  New Revision: 60724

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

  Log:
    fix peephole optimization.
    
    * compile.c (iseq_peephole_optimize): do not need to put `pop`
      instruction.
    
    * test/ruby/test_optimization.rb (test_peephole_optimization_without_trace):
      This code "def foo; 1.times{|(a), &b| nil && a}; end" fails to compile
      by stack underflow because of above bug (fixed by this patch).

  Modified files:
    trunk/compile.c
    trunk/test/ruby/test_optimization.rb


More information about the ruby-cvs mailing list