X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=Repair%2FRepairCompiler%2FMCC%2FIR%2FStructureTypeDescriptor.java;h=f0808e825020ba07d1ba938f4e9d67244b94613f;hb=445c4854d296285d0ed336f8cb9002ab2e3e75bc;hp=32d38f567c278164078551576072b11b68c0ed8b;hpb=a8d1f83099dff307e67a60a7e40074e22c1ed128;p=repair.git diff --git a/Repair/RepairCompiler/MCC/IR/StructureTypeDescriptor.java b/Repair/RepairCompiler/MCC/IR/StructureTypeDescriptor.java index 32d38f5..f0808e8 100755 --- a/Repair/RepairCompiler/MCC/IR/StructureTypeDescriptor.java +++ b/Repair/RepairCompiler/MCC/IR/StructureTypeDescriptor.java @@ -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); } }