better error reporting (pc and method name)
authorbrian <brian@brianweb.net>
Sun, 3 Jul 2005 21:21:23 +0000 (21:21 +0000)
committerbrian <brian@brianweb.net>
Sun, 3 Jul 2005 21:21:23 +0000 (21:21 +0000)
darcs-hash:20050703212123-24bed-68e06fb132368d5269a61399b9a2ba5d5c1b53f3.gz

src/org/ibex/classgen/JSSA.java

index 8582df2..090fc97 100644 (file)
@@ -20,10 +20,16 @@ public class JSSA extends MethodGen implements CGConst {
         for(int i=0; i<size(); i++) {
             int    op  = get(i);
             Object arg = getArg(i);
-            Object o = addOp(op, arg);
-            if (o != null) {
-                ops[numOps] = o;
-                ofs[numOps++] = i;
+            try {
+                Object o = addOp(op, arg);
+                if (o != null) {
+                    ops[numOps] = o;
+                    ofs[numOps++] = i;
+                }
+            } catch(RuntimeException e) {
+                System.err.println("Had a problem at PC: " + i + " of " + method);
+                e.printStackTrace();
+                throw new IOException("invalid class file");
             }
         }
     }