From e917af64014746de9658e1a9ddb3fd134520c0e6 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 2 Dec 2015 07:31:23 +0000 Subject: compile.c: fix the element * compile.c (iseq_set_sequence): fix the element for line number to rb_compile_bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/compile.c b/compile.c index d234c5c742..d84f487ba4 100644 --- a/compile.c +++ b/compile.c @@ -1486,8 +1486,6 @@ cdhash_set_label_i(VALUE key, VALUE val, void *ptr) static int iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor) { - LABEL *lobj; - INSN *iobj; struct iseq_line_info_entry *line_info_table; unsigned int last_line = 0; LINK_ELEMENT *list; @@ -1502,7 +1500,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor) switch (list->type) { case ISEQ_ELEMENT_INSN: { - iobj = (INSN *)list; + INSN *iobj = (INSN *)list; line = iobj->line_no; code_index += insn_data_length(iobj); insn_num++; @@ -1510,7 +1508,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor) } case ISEQ_ELEMENT_LABEL: { - lobj = (LABEL *)list; + LABEL *lobj = (LABEL *)list; lobj->position = code_index; lobj->set = TRUE; break; @@ -1558,8 +1556,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor) int j, len, insn; const char *types; VALUE *operands; - - iobj = (INSN *)list; + INSN *iobj = (INSN *)list; /* update sp */ sp = calc_sp_depth(sp, iobj); @@ -1593,7 +1590,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor) case TS_OFFSET: { /* label(destination position) */ - lobj = (LABEL *)operands[j]; + LABEL *lobj = (LABEL *)operands[j]; if (!lobj->set) { COMPILE_ERROR((ruby_sourcefile, iobj->line_no, "unknown label")); @@ -1704,7 +1701,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor) } case ISEQ_ELEMENT_LABEL: { - lobj = (LABEL *)list; + LABEL *lobj = (LABEL *)list; if (lobj->sp == -1) { lobj->sp = sp; } @@ -1746,7 +1743,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor) generated_iseq[code_index++] = BIN(nop); } else { - rb_compile_bug(ruby_sourcefile, iobj->line_no, + rb_compile_bug(ruby_sourcefile, adjust->line_no, "iseq_set_sequence: adjust bug %d < %d", orig_sp, sp); } } -- cgit v1.2.3