summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gc.c3
-rw-r--r--vm_core.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index cb8e6fee11..b1edf21d77 100644
--- a/gc.c
+++ b/gc.c
@@ -9272,10 +9272,11 @@ rb_raw_iseq_info(char *buff, const int buff_size, const rb_iseq_t *iseq)
{
if (iseq->body && iseq->body->location.label) {
VALUE path = rb_iseq_path(iseq);
+ VALUE n = iseq->body->location.first_lineno;
snprintf(buff, buff_size, "%s %s@%s:%d", buff,
RSTRING_PTR(iseq->body->location.label),
RSTRING_PTR(path),
- FIX2INT(iseq->body->location.first_lineno));
+ n ? FIX2INT(n) : 0 );
}
}
diff --git a/vm_core.h b/vm_core.h
index 3691d13fa5..f2ea983d36 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -1406,6 +1406,7 @@ vm_proc_ep(VALUE procval)
static inline const rb_iseq_t *
vm_block_iseq(const struct rb_block *block)
{
+ if (!block) return NULL;
switch (vm_block_type(block)) {
case block_type_iseq: return rb_iseq_check(block->as.captured.code.iseq);
case block_type_proc: return vm_proc_iseq(block->as.proc);