projects
/
repair.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added:
[repair.git]
/
Repair
/
RepairCompiler
/
MCC
/
IR
/
StructureTypeDescriptor.java
diff --git
a/Repair/RepairCompiler/MCC/IR/StructureTypeDescriptor.java
b/Repair/RepairCompiler/MCC/IR/StructureTypeDescriptor.java
index 222c6c1134fcb4d9eeeb25fe19791d39f4d51fb0..f0808e825020ba07d1ba938f4e9d67244b94613f 100755
(executable)
--- 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();
Vector fieldlist = new Vector(); /* ordering information */
Hashtable labels = new Hashtable();
+
public StructureTypeDescriptor(String name) {
super(name);
}
public StructureTypeDescriptor(String name) {
super(name);
}
@@
-34,7
+35,10
@@
public class StructureTypeDescriptor extends TypeDescriptor {
}
public Expr getOffsetExpr(FieldDescriptor field) {
}
public Expr getOffsetExpr(FieldDescriptor field) {
-
+ /* Fix sizeof calculations */
+ if ((field==null)&&(subtype!=null))
+ return subtype.getSizeExpr();
+
boolean aligned=true;
Expr size = new IntegerLiteralExpr(0);
boolean aligned=true;
Expr size = new IntegerLiteralExpr(0);
@@
-117,11
+121,11
@@
public class StructureTypeDescriptor extends TypeDescriptor {
labels.put(ld.getSymbol(), ld);
}
labels.put(ld.getSymbol(), ld);
}
- public TypeDescriptor getSu
b
Type() {
+ public TypeDescriptor getSu
per
Type() {
return subtype;
}
return subtype;
}
- public void setSu
b
Type(TypeDescriptor td) {
+ public void setSu
per
Type(TypeDescriptor td) {
subtype = td;
}
subtype = td;
}
@@
-129,6
+133,8
@@
public class StructureTypeDescriptor extends TypeDescriptor {
if (td == this) {
return true;
} else {
if (td == this) {
return true;
} else {
+ if (subtype==null)
+ return false;
return subtype.isSubtypeOf(td);
}
}
return subtype.isSubtypeOf(td);
}
}