This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Tail sets


* Helmut Eller [2009-06-29 12:23+0200] writes:

> Presumably because this requires now very long jumps.

... or not.  Anyway the change below fixes the problem enough to let the
compilation finish:

Index: CodeAttr.java
===================================================================
--- CodeAttr.java	(revision 6276)
+++ CodeAttr.java	(working copy)
@@ -1872,10 +1872,17 @@
 	  = if_stack.start_stack_size + if_stack.stack_growth;
 	if (! reachableHere ())
 	  {
-	    if (if_stack.stack_growth > 0)
-	      System.arraycopy (if_stack.then_stacked_types, 0,
-				stack_types, if_stack.start_stack_size,
-				if_stack.stack_growth);
+	      if (if_stack.stack_growth > 0) {
+		  while (stack_types.length < then_clause_stack_size) {
+		      Type[] new_array = new Type[2 * stack_types.length + 1];
+		      System.arraycopy (stack_types, 0, new_array, 0, 
+					stack_types.length);
+		      stack_types = new_array;
+		  }
+		  System.arraycopy (if_stack.then_stacked_types, 0,
+				    stack_types, if_stack.start_stack_size,
+				    if_stack.stack_growth);
+	      }
 	    SP = then_clause_stack_size;
 	  }
 	else if (SP != then_clause_stack_size)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]