diff --git a/iseq.c b/iseq.c index 93e58db2e65..f2db484f59f 100644 --- a/iseq.c +++ b/iseq.c @@ -3002,6 +3002,10 @@ rb_iseq_disasm_recursive(const rb_iseq_t *iseq, VALUE indent) n += rb_iseq_disasm_insn(str, code, n, iseq, child); } + if (body->mandatory_only_iseq) { + rb_ary_push(child, (VALUE)body->mandatory_only_iseq); + } + for (l = 0; l < RARRAY_LEN(child); l++) { VALUE isv = rb_ary_entry(child, l); if (done_iseq && st_is_member(done_iseq, (st_data_t)isv)) continue; diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb index 30931587f8b..0a06d01b08a 100644 --- a/test/ruby/test_iseq.rb +++ b/test/ruby/test_iseq.rb @@ -524,6 +524,12 @@ class TestISeq < Test::Unit::TestCase assert_equal [:&], param_names end + def test_disasm_mandatory_only_overloaded + disasm = RubyVM::InstructionSequence.disasm(Time.method(:at)) + assert_include disasm, "" + assert_include disasm, "" + end + def strip_lineno(source) source.gsub(/^.*?: /, "") end