summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-21 17:25:43 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-21 17:25:43 +0000
commit32c7a56555b7099431cc98ff2bed3ca8330d5f82 (patch)
tree10e956afa4ec2eef25574613e52cd20acfcc31c0 /iseq.c
parent2de66ecbfc8c6c9c76f81db3e706b5a24af30e08 (diff)
* iseq.c (iseq_inspect): don't raise on uninitialized object.
show real class name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/iseq.c b/iseq.c
index 84c3b74..b964176 100644
--- a/iseq.c
+++ b/iseq.c
@@ -548,9 +548,14 @@ iseq_eval(VALUE self)
static VALUE
iseq_inspect(VALUE self)
{
- rb_iseq_t *iseq = iseq_check(self);
+ rb_iseq_t *iseq;
+ GetISeqPtr(self, iseq);
+ if (!iseq->name) {
+ return rb_sprintf("#<%s: uninitialized>", rb_obj_classname(self));
+ }
- return rb_sprintf("<ISeq:%s@%s>",
+ return rb_sprintf("<%s:%s@%s>",
+ rb_obj_classname(self),
RSTRING_PTR(iseq->name), RSTRING_PTR(iseq->filename));
}