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

ruby-changes:47536

From: nobu <ko1@a...>
Date: Thu, 24 Aug 2017 16:32:01 +0900 (JST)
Subject: [ruby-changes:47536] nobu:r59652 (trunk): compile.c: show failed instructions

nobu	2017-08-24 16:31:56 +0900 (Thu, 24 Aug 2017)

  New Revision: 59652

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

  Log:
    compile.c: show failed instructions
    
    * compile.c (iseq_set_sequence): show failed instructions at
      adjuststack mismatch.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 59651)
+++ compile.c	(revision 59652)
@@ -1000,6 +1000,8 @@ debug_list(ISEQ_ARG_DECLARE LINK_ANCHOR https://github.com/ruby/ruby/blob/trunk/compile.c#L1000
 #if CPDEBUG < 0
 #define debug_list(anc) debug_list(iseq, (anc))
 #endif
+#else
+#define debug_list(anc) ((void)0)
 #endif
 
 static LABEL *
@@ -1914,11 +1916,13 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L1916
 			generated_iseq[code_index++] = BIN(pop);
 		    }
 		    else if (diff < 0) {
+			int label_no = adjust->label ? adjust->label->label_no : -1;
 			xfree(generated_iseq);
 			xfree(line_info_table);
+			debug_list(anchor);
 			COMPILE_ERROR(iseq, adjust->line_no,
-				      "iseq_set_sequence: adjust bug %d < %d",
-				      orig_sp, sp);
+				      "iseq_set_sequence: adjust bug to %d %d < %d",
+				      label_no, orig_sp, sp);
 			return COMPILE_NG;
 		    }
 		}

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

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