Project

General

Profile

« Previous | Next » 

Revision 976b6df9

Added by ko1 (Koichi Sasada) about 8 years ago

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).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e