Added:
[repair.git] / Repair / RepairCompiler / MCC / IR / StructureTypeDescriptor.java
index 32d38f567c278164078551576072b11b68c0ed8b..f0808e825020ba07d1ba938f4e9d67244b94613f 100755 (executable)
@@ -15,16 +15,10 @@ public class StructureTypeDescriptor extends TypeDescriptor {
     Hashtable fields = new Hashtable(); /* fast lookups */
     Vector fieldlist = new Vector(); /* ordering information */
     Hashtable labels = new Hashtable();
-    int idnum;
-    static int counter=0;
 
-    public int getId() {
-       return idnum;
-    }
 
     public StructureTypeDescriptor(String name) {
         super(name);
-       idnum=counter++;
     }
 
     public TypeDescriptor getGenerateType() {
@@ -43,7 +37,7 @@ public class StructureTypeDescriptor extends TypeDescriptor {
     public Expr getOffsetExpr(FieldDescriptor field) {
        /* Fix sizeof calculations */
        if ((field==null)&&(subtype!=null))
-           return subtype.getOFfsetExpr(field);
+           return subtype.getSizeExpr();
 
        boolean aligned=true;
         Expr size = new IntegerLiteralExpr(0);
@@ -139,6 +133,8 @@ public class StructureTypeDescriptor extends TypeDescriptor {
         if (td == this) {
             return true;
         } else {
+           if (subtype==null)
+               return false;
             return subtype.isSubtypeOf(td);
         }
     }