From d8c3672b012ec6eb55e097162c6c638e8d932471 Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 13 Jul 2016 05:26:00 +0000 Subject: * iseq.c (Init_ISeq): undef ISeq.translate and ISeq.load_iseq to prevent calling super classes' methods. Without this patch, you can write workaround like: class << RubyVM::InstructionSequence def translate; end undef translate end * test/ruby/test_iseq.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_iseq.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb index a71ad565f7..dba714aa62 100644 --- a/test/ruby/test_iseq.rb +++ b/test/ruby/test_iseq.rb @@ -235,4 +235,14 @@ class TestISeq < Test::Unit::TestCase end assert_equal([m1, e1.message], [m2, e2.message], feature11951) end + + def test_translate_by_object + assert_separately([], <<-"end;") + class Object + def translate + end + end + assert_equal(0, eval("0")) + end; + end end -- cgit v1.2.3