From d7c6776f7c8c94d0a5443fc1c5290561ef527f5b Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 25 Dec 2017 04:40:42 +0000 Subject: [PATCH] Disasm output contains code range. * iseq.c (iseq_inspect): show also code range information. Note that `iseq_inspect` is used only for header of disasm. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- iseq.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iseq.c b/iseq.c index 5349484ead..ac92237f38 100644 --- a/iseq.c +++ b/iseq.c @@ -1658,9 +1658,13 @@ iseq_inspect(const rb_iseq_t *iseq) return rb_sprintf("#"); } else { - return rb_sprintf("#", + return rb_sprintf("#", RSTRING_PTR(iseq->body->location.label), RSTRING_PTR(rb_iseq_path(iseq)), - FIX2INT(rb_iseq_first_lineno(iseq))); + iseq->body->location.code_range.first_loc.lineno, + iseq->body->location.code_range.first_loc.lineno, + iseq->body->location.code_range.first_loc.column, + iseq->body->location.code_range.last_loc.lineno, + iseq->body->location.code_range.last_loc.column); } }