aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-13 05:26:00 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-13 05:26:00 +0000
commit4795569659f6f3b2024f2e82ccbfe5835af5189f (patch)
tree570d361546288e014323e46cb92bd49192d3f4a8 /iseq.c
parent508cc7a161f76621a14c0af43bce979b9b397ddd (diff)
downloadruby-4795569659f6f3b2024f2e82ccbfe5835af5189f.tar.gz
* 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
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/iseq.c b/iseq.c
index 28d35eb328..1c22fea74d 100644
--- a/iseq.c
+++ b/iseq.c
@@ -2462,4 +2462,7 @@ Init_ISeq(void)
rb_define_singleton_method(rb_cISeq, "disasm", iseqw_s_disasm, 1);
rb_define_singleton_method(rb_cISeq, "disassemble", iseqw_s_disasm, 1);
rb_define_singleton_method(rb_cISeq, "of", iseqw_s_of, 1);
+
+ rb_undef_method(CLASS_OF(rb_cISeq), "translate");
+ rb_undef_method(CLASS_OF(rb_cISeq), "load_iseq");
}