summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/vm_dump.c b/vm_dump.c
index 607488388a..93179fedc8 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -89,6 +89,9 @@ control_frame_dump(const rb_execution_context_t *ec, const rb_control_frame_t *c
case VM_FRAME_MAGIC_RESCUE:
magic = "RESCUE";
break;
+ case VM_FRAME_MAGIC_DUMMY:
+ magic = "DUMMY";
+ break;
case 0:
magic = "------";
break;
@@ -117,12 +120,17 @@ control_frame_dump(const rb_execution_context_t *ec, const rb_control_frame_t *c
line = -1;
}
else {
- iseq = cfp->iseq;
- pc = cfp->pc - ISEQ_BODY(iseq)->iseq_encoded;
- iseq_name = RSTRING_PTR(ISEQ_BODY(iseq)->location.label);
- line = rb_vm_get_sourceline(cfp);
- if (line) {
- snprintf(posbuf, MAX_POSBUF, "%s:%d", RSTRING_PTR(rb_iseq_path(iseq)), line);
+ if (cfp->pc) {
+ iseq = cfp->iseq;
+ pc = cfp->pc - ISEQ_BODY(iseq)->iseq_encoded;
+ iseq_name = RSTRING_PTR(ISEQ_BODY(iseq)->location.label);
+ line = rb_vm_get_sourceline(cfp);
+ if (line) {
+ snprintf(posbuf, MAX_POSBUF, "%s:%d", RSTRING_PTR(rb_iseq_path(iseq)), line);
+ }
+ }
+ else {
+ iseq_name = "<dummy_frame>";
}
}
}