X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=Repair%2FRepairCompiler%2FMCC%2FIR%2FStructureTypeDescriptor.java;h=f0808e825020ba07d1ba938f4e9d67244b94613f;hb=445c4854d296285d0ed336f8cb9002ab2e3e75bc;hp=222c6c1134fcb4d9eeeb25fe19791d39f4d51fb0;hpb=0092f02d48abd3603fa7c5115e8f5a63ada45f68;p=repair.git diff --git a/Repair/RepairCompiler/MCC/IR/StructureTypeDescriptor.java b/Repair/RepairCompiler/MCC/IR/StructureTypeDescriptor.java index 222c6c1..f0808e8 100755 --- a/Repair/RepairCompiler/MCC/IR/StructureTypeDescriptor.java +++ b/Repair/RepairCompiler/MCC/IR/StructureTypeDescriptor.java @@ -16,6 +16,7 @@ public class StructureTypeDescriptor extends TypeDescriptor { Vector fieldlist = new Vector(); /* ordering information */ Hashtable labels = new Hashtable(); + public StructureTypeDescriptor(String name) { super(name); } @@ -34,7 +35,10 @@ public class StructureTypeDescriptor extends TypeDescriptor { } public Expr getOffsetExpr(FieldDescriptor field) { - + /* Fix sizeof calculations */ + if ((field==null)&&(subtype!=null)) + return subtype.getSizeExpr(); + boolean aligned=true; Expr size = new IntegerLiteralExpr(0); @@ -117,11 +121,11 @@ public class StructureTypeDescriptor extends TypeDescriptor { labels.put(ld.getSymbol(), ld); } - public TypeDescriptor getSubType() { + public TypeDescriptor getSuperType() { return subtype; } - public void setSubType(TypeDescriptor td) { + public void setSuperType(TypeDescriptor td) { subtype = td; } @@ -129,6 +133,8 @@ public class StructureTypeDescriptor extends TypeDescriptor { if (td == this) { return true; } else { + if (subtype==null) + return false; return subtype.isSubtypeOf(td); } }