summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--iseq.c9
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3942b9c970..413b60e34d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Aug 22 02:25:04 2008 Tanaka Akira <akr@fsij.org>
+
+ * iseq.c (iseq_inspect): don't raise on uninitialized object.
+ show real class name.
+
Fri Aug 22 02:08:58 2008 Tanaka Akira <akr@fsij.org>
* io.c (rb_io_initialize): accept hash argument.
diff --git a/iseq.c b/iseq.c
index 84c3b741e5..b9641763da 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));
}