From cffb09aa80e185eb92f2ecaa19a7b51d2a5267db Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 23 May 2017 12:11:57 +0000 Subject: [PATCH] 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 --- compile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compile.c b/compile.c index 20b6c68d30..3939ea0360 100644 --- a/compile.c +++ b/compile.c @@ -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 "" #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, "", 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("\n", lobj->label_no); + printf(LABEL_FORMAT"\n", lobj->label_no); break; } case ISEQ_ELEMENT_NONE: