diff options
-rw-r--r-- | gc.c | 11 | ||||
-rw-r--r-- | version.h | 2 |
2 files changed, 9 insertions, 4 deletions
@@ -9207,11 +9207,12 @@ method_type_name(rb_method_type_t type) static void rb_raw_iseq_info(char *buff, const int buff_size, const rb_iseq_t *iseq) { - if (iseq->body->location.label) { + if (iseq->body && iseq->body->location.label) { + VALUE n = iseq->body->location.first_lineno; snprintf(buff, buff_size, "%s %s@%s:%d", buff, RSTRING_PTR(iseq->body->location.label), RSTRING_PTR(iseq->body->location.path), - FIX2INT(iseq->body->location.first_lineno)); + n ? FIX2INT(n) : 0 ); } } @@ -9282,8 +9283,12 @@ rb_raw_obj_info(char *buff, const int buff_size, VALUE obj) break; } case T_DATA: { + const struct rb_block *block; const rb_iseq_t *iseq; - if (rb_obj_is_proc(obj) && (iseq = vm_proc_iseq(obj)) != NULL) { + if (rb_obj_is_proc(obj) && + (block = vm_proc_block(obj)) != NULL && + (vm_block_type(block) == block_type_iseq) && + (iseq = vm_block_iseq(block)) != NULL) { rb_raw_iseq_info(buff, buff_size, iseq); } else { @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.4.4" #define RUBY_RELEASE_DATE "2018-03-20" -#define RUBY_PATCHLEVEL 272 +#define RUBY_PATCHLEVEL 273 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 3 |