ruby-changes:49348
From: ko1 <ko1@a...>
Date: Mon, 25 Dec 2017 13:40:47 +0900 (JST)
Subject: [ruby-changes:49348] ko1:r61463 (trunk): Disasm output contains code range.
ko1 2017-12-25 13:40:42 +0900 (Mon, 25 Dec 2017) New Revision: 61463 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61463 Log: 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. Modified files: trunk/iseq.c Index: iseq.c =================================================================== --- iseq.c (revision 61462) +++ iseq.c (revision 61463) @@ -1658,9 +1658,13 @@ iseq_inspect(const rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/iseq.c#L1658 return rb_sprintf("#<ISeq: uninitialized>"); } else { - return rb_sprintf("#<ISeq:%s@%s:%d>", + return rb_sprintf("#<ISeq:%s@%s:%d (%d,%d)-(%d,%d)>", 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); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/