1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

LABEL_FORMAT

* compile.c (LABEL_FORMAT): extract format string for labels.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-05-23 12:11:57 +00:00
parent dfc11063da
commit cffb09aa80

View file

@ -173,6 +173,7 @@ struct iseq_compile_data_ensure_node_stack {
/* create new label */
#define NEW_LABEL(l) new_label_body(iseq, (l))
#define LABEL_FORMAT "<L%03d>"
#define iseq_path(iseq) ((iseq)->body->location.path)
#define iseq_absolute_path(iseq) ((iseq)->body->location.absolute_path)
@ -6444,7 +6445,7 @@ insn_data_to_s_detail(INSN *iobj)
case TS_OFFSET: /* label(destination position) */
{
LABEL *lobj = (LABEL *)OPERAND_AT(iobj, j);
rb_str_catf(str, "<L%03d>", lobj->label_no);
rb_str_catf(str, LABEL_FORMAT, lobj->label_no);
break;
}
break;
@ -6550,7 +6551,7 @@ dump_disasm_list_with_cursor(const LINK_ELEMENT *link, const LINK_ELEMENT *curr)
case ISEQ_ELEMENT_LABEL:
{
lobj = (LABEL *)link;
printf("<L%03d>\n", lobj->label_no);
printf(LABEL_FORMAT"\n", lobj->label_no);
break;
}
case ISEQ_ELEMENT_NONE: