case FKind.FlatFieldNode:
case FKind.FlatElementNode: {
+
if (fn.kind() == FKind.FlatFieldNode) {
FlatFieldNode ffn = (FlatFieldNode) fn;
lhs = ffn.getDst();
// read field
NTuple<Descriptor> srcHeapPath = mapHeapPath.get(rhs);
- NTuple<Descriptor> fldHeapPath = new NTuple<Descriptor>(srcHeapPath.getList());
+ System.out.println("rhs=" + rhs);
+ NTuple<Descriptor> fldHeapPath;
+ if (srcHeapPath != null) {
+ fldHeapPath = new NTuple<Descriptor>(srcHeapPath.getList());
+ } else {
+ // if srcHeapPath is null, it is static reference
+ fldHeapPath = new NTuple<Descriptor>();
+ }
fldHeapPath.add(fld);
if (fld.getType().isImmutable()) {
inputSet.add(rightLoc);
CompositeLocation glbCompLoc =
CompositeLattice.calculateGLB(inputSet, generateErrorMessage(cd, on));
- // System.out.println("# glbCompLoc=" + glbCompLoc);
return glbCompLoc;
default:
loc.addLocation(fieldLoc);
} else if (d == null) {
// access static field
- ClassDescriptor cd = nn.getClassDesc();
+ FieldDescriptor fd = nn.getField();
MethodLattice<String> localLattice = ssjava.getMethodLattice(md);
String globalLocId = localLattice.getGlobalLoc();
+ generateErrorMessage(md.getClassDesc(), nn));
}
loc.addLocation(new Location(md, globalLocId));
+
+ Location fieldLoc = (Location) fd.getType().getExtension();
+ loc.addLocation(fieldLoc);
+
return loc;
}