[前][次][番号順一覧][スレッド一覧]

ruby-changes:40778

From: nobu <ko1@a...>
Date: Wed, 2 Dec 2015 16:31:30 +0900 (JST)
Subject: [ruby-changes:40778] nobu:r52857 (trunk): compile.c: fix the element

nobu	2015-12-02 16:31:23 +0900 (Wed, 02 Dec 2015)

  New Revision: 52857

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52857

  Log:
    compile.c: fix the element
    
    * compile.c (iseq_set_sequence): fix the element for line number
      to rb_compile_bug.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 52856)
+++ compile.c	(revision 52857)
@@ -1486,8 +1486,6 @@ cdhash_set_label_i(VALUE key, VALUE val, https://github.com/ruby/ruby/blob/trunk/compile.c#L1486
 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_ https://github.com/ruby/ruby/blob/trunk/compile.c#L1500
 	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_ https://github.com/ruby/ruby/blob/trunk/compile.c#L1508
 	    }
 	  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_ https://github.com/ruby/ruby/blob/trunk/compile.c#L1556
 		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_ https://github.com/ruby/ruby/blob/trunk/compile.c#L1590
 		      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_ https://github.com/ruby/ruby/blob/trunk/compile.c#L1701
 	    }
 	  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_ https://github.com/ruby/ruby/blob/trunk/compile.c#L1743
 			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);
 		    }
 		}

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]