1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* compile.c (iseq_compile_each): check

iseq->compile_data->option->specialized_instruction for opt_* insn.
* test/ruby/test_iseq.rb: check no specialized_instructions option.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2014-12-17 01:20:22 +00:00
parent fcf6fa8781
commit 6eac885ebe
3 changed files with 23 additions and 5 deletions

View file

@ -124,4 +124,14 @@ class TestISeq < Test::Unit::TestCase
ISeq.of(c.instance_method(:foobar)).label
assert_same a, b
end
def test_diable_opt
src = "a['foo'] = a['bar']; 'a'.freeze"
_,_,_,_,_,_,_,_,_,_,_,_,_,body= RubyVM::InstructionSequence.compile(src, __FILE__, __FILE__, __LINE__, false).to_a
body.each{|insn|
next if Integer === insn
op = insn.first
assert(!op.to_s.match(/^opt_/), "#{op}")
}
end
end