diff options
-rw-r--r-- | gc.c | 3 | ||||
-rw-r--r-- | vm_core.h | 1 |
2 files changed, 3 insertions, 1 deletions
@@ -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 ); } } @@ -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); |