fix compiler error on processing bad code
[org.ibex.tool.git] / src / org / ibex / tool / Compiler.java
index bf1ad56..f79f461 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright 2000-2005 the Contributors, as shown in the revision logs.
+// Licensed under the Apache Public Source License 2.0 ("the License").
+// You may not use this file except in compliance with the License.
+
 package org.ibex.tool;
 
 import java.io.*;
@@ -362,7 +366,7 @@ public class Compiler {
     // Compiler Parameters ////////////////////////////////////////////////////
 
     // FEATURE: may be able to use this to block access to APIs generated for stack objects
-    final AccessRestriction access = new AccessRestriction(null, null, null, null);
+    final AccessRestriction access = null;
 
     /** Used by compiler to resolve classes. */
     final INameEnvironment env = new INameEnvironment() {
@@ -379,6 +383,7 @@ public class Compiler {
                     bytes(c), (str(p, '/') + '/' + classname).toCharArray()));
                 return new NameEnvironmentAnswer(b, access);
             } catch (ClassNotFoundException e) {
+            } catch (LinkageError e) {
             } catch (ClassFormatException e) {
                 e.printStackTrace();
                 throw new Error("ClassFormatException reading system class: " +
@@ -410,8 +415,8 @@ public class Compiler {
                     }
                 }
             } catch (ClassFormatException e) {
-                System.out.println("Unexpected ClassFormatException"); // FIXME
-                e.printStackTrace(); return null;
+                e.printStackTrace();
+                throw new Error("unexpected ClassFormatException resolving compiled class: "+e);
             }
             if (veryverbose) System.out.println("  not found");
             return null;