зеркало из https://github.com/github/ruby.git
* iseq.c (iseq_s_disasm): return nil for native methods.
[ruby-core:27226], [Bug#2499] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
d3fc1d3e3a
Коммит
e6a8408c2c
|
@ -205,7 +205,6 @@ NORETURN(void rb_raise_method_missing(rb_thread_t *th, int argc, VALUE *argv,
|
|||
|
||||
VALUE rb_vm_make_jump_tag_but_local_jump(int state, VALUE val);
|
||||
NODE *rb_vm_cref(void);
|
||||
VALUE rb_obj_is_proc(VALUE);
|
||||
VALUE rb_vm_call_cfunc(VALUE recv, VALUE (*func)(VALUE), VALUE arg, const rb_block_t *blockptr, VALUE filename);
|
||||
void rb_vm_set_progname(VALUE filename);
|
||||
void rb_thread_terminate_all(void);
|
||||
|
|
|
@ -303,6 +303,7 @@ VALUE rb_class_new_instance(int, VALUE*, VALUE);
|
|||
VALUE rb_block_proc(void);
|
||||
VALUE rb_f_lambda(void);
|
||||
VALUE rb_proc_new(VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE);
|
||||
VALUE rb_obj_is_proc(VALUE);
|
||||
VALUE rb_proc_call(VALUE, VALUE);
|
||||
VALUE rb_proc_call_with_block(VALUE, int argc, VALUE *argv, VALUE);
|
||||
int rb_proc_arity(VALUE);
|
||||
|
|
2
iseq.c
2
iseq.c
|
@ -1015,7 +1015,7 @@ iseq_s_disasm(VALUE klass, VALUE body)
|
|||
if ((iseq = rb_method_get_iseq(body)) != 0) {
|
||||
ret = rb_iseq_disasm(iseq->self);
|
||||
}
|
||||
else {
|
||||
else if (rb_obj_is_proc(body)) {
|
||||
rb_proc_t *proc;
|
||||
VALUE iseqval;
|
||||
GetProcPtr(body, proc);
|
||||
|
|
|
@ -82,6 +82,7 @@ class TestMethod < Test::Unit::TestCase
|
|||
o = Object.new
|
||||
def o.foo; end
|
||||
assert_nothing_raised { RubyVM::InstructionSequence.disasm(o.method(:foo)) }
|
||||
assert_nothing_raised { RubyVM::InstructionSequence.disasm("x".method(:upcase)) }
|
||||
end
|
||||
|
||||
def test_new
|
||||
|
|
Загрузка…
Ссылка в новой задаче