This is the mail archive of the kawa@sources.redhat.com 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]

Re: Internal compiler error


Jocelyn Paine <popx@pop3.ifs.org.uk> writes:

> Just to add a bit of detail to this message I sent last night, I was using
> java kawa.repl with the -P and -C options to compile a .scm file. Kawa
> crashed part of the way through with the trace shown. I presume the class
> cast exception is not referring to a Boolean in the program being
> compiled, but in the compiler.

My guess is some Boolean literal that is confusing the compiler.
The compiler allocates a field for each variable in a module,
or that otherwise cannot be allocated in a variable.  Perhaps
this variable has a type declaration?

> It could be useful if the internal-error-report were
> to display the term being processed,

There is no term being processed at this point, since it is setting
things up at the function level, so this is difficult.  But could
you see if the patch below helps any?

One thing to try is wrap the offending line Field.setConstantValue
in a try/catch, and in te catch print out the name of the field.
Better, set a try/catch in Declaration.makeField, and you can then print
out getName and getLine.

Index: Compilation.java
===================================================================
RCS file: /cvs/kawa/kawa/gnu/expr/Compilation.java,v
retrieving revision 1.53
diff -u -r1.53 Compilation.java
--- Compilation.java	2001/07/18 19:48:13	1.53
+++ Compilation.java	2001/07/19 00:23:21
@@ -630,7 +630,15 @@
 
     mainClass = addClass(lexp, mainClass);
     literalTable = new Hashtable (100);
-    addClass (lexp);
+    try
+      {
+	addClass (lexp);
+      }
+    catch (RuntimeException ex)
+      {
+	error('f', "Internal compiler exception: "+ex);
+	throw ex;
+      }
   }
 
   public void addClass (ClassType new_class)

-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


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