summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-20 04:26:20 +0000
committerktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-20 04:26:20 +0000
commit5cb16a55f56220eb8a0e0bfa69c5427023a12975 (patch)
tree9c048c7059288824ab553f4125e3a50a67adcdca /iseq.c
parent4536f22a69d719d04eb7e597a10c48732e80607d (diff)
* iseq.c (iseq_s_disasm): fix a bug that may cause SEGV.
* test/ruby/test_method.rb (test_body): add a test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/iseq.c b/iseq.c
index c0cf98357f..9737d615c1 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1030,9 +1030,9 @@ iseq_s_disasm(VALUE klass, VALUE body)
rb_proc_t *proc;
VALUE iseqval;
GetProcPtr(body, proc);
- iseqval = proc->block.iseq->self;
- if (RUBY_VM_NORMAL_ISEQ_P(iseqval)) {
- ret = rb_iseq_disasm(iseqval);
+ iseq = proc->block.iseq;
+ if (RUBY_VM_NORMAL_ISEQ_P(iseq)) {
+ ret = rb_iseq_disasm(iseq->self);
}
}
else if ((iseq = rb_method_get_iseq(body)) != 0) {