fixed HIDEOUS bug in ConstantPool -- was circumventing Type-instance caching (evil...
authoradam <adam@megacz.com>
Sun, 3 Jul 2005 04:54:03 +0000 (04:54 +0000)
committeradam <adam@megacz.com>
Sun, 3 Jul 2005 04:54:03 +0000 (04:54 +0000)
darcs-hash:20050703045403-5007d-fa632b4cb7117316a087a362d1647fd860ec7010.gz

src/org/ibex/classgen/ConstantPool.java
src/org/ibex/classgen/Type.java

index 4d62df7..5868f62 100644 (file)
@@ -86,7 +86,7 @@ class ConstantPool implements CGConst {
         ClassEnt(String s) { this(); this.utf8 = (Utf8Ent) addUtf8(s); }
         void dump(DataOutput o) throws IOException { super.dump(o); o.writeShort(utf8.n); }
         Type.Class getTypeClass() { return  (Type.Class) key(); }
-        Object _key() { return new Type.Class(utf8.s); }
+        Object _key() { return Type.Class.instance(utf8.s); }
         void unref() { utf8.unref(); super.unref(); }
         String debugToString() { return "[Class: " + utf8.s + "]"; }
     }
index 44e6476..aacbfe4 100644 (file)
@@ -118,7 +118,7 @@ public abstract class Type implements CGConst {
             return p == -1 ? descriptor.substring(1,descriptor.length()-1) : descriptor.substring(p+1,descriptor.length()-1);
         }
         private static String _initHelper(String s) {
-            if (!s.startsWith("L") || !s.endsWith(";")) s = "L" + s.replace('.', '/') + ";";
+            if (!s.startsWith("L") || !s.endsWith(";")) throw new Error("invalid");
             return s;
         }
         String[] components() {