TempDescriptor x,
FieldDescriptor f,
TempDescriptor y,
- Set<EdgeKey> edgeKeysRemoved ) {
+ Set<EdgeKey> edgeKeysRemoved,
+ Set<EdgeKey> edgeKeysAdded ) {
DefiniteReachState state = makeIn( fn );
- state.store( x, f, y, edgeKeysRemoved );
+ state.store( x, f, y, edgeKeysRemoved, edgeKeysAdded );
fn2state.put( fn, state );
}
TempDescriptor y,
FieldDescriptor f,
Set<EdgeKey> edgeKeysForLoad ) {
+
loadR( x, y, f, edgeKeysForLoad );
// Rs' := (Rs - <x,*>) U {<x, unknown>}
//Rs.put( x, DefReachKnown.UNKNOWN );
public void store( TempDescriptor x,
FieldDescriptor f,
TempDescriptor y,
- Set<EdgeKey> edgeKeysRemoved ) {
- storeR( x, f, y, edgeKeysRemoved );
+ Set<EdgeKey> edgeKeysRemoved,
+ Set<EdgeKey> edgeKeysAdded ) {
+
+ storeR( x, f, y, edgeKeysRemoved, edgeKeysAdded );
// Rs' := Rs
}
public void storeR( TempDescriptor x,
FieldDescriptor f,
TempDescriptor y,
- Set<EdgeKey> edgeKeysRemoved ) {
+ Set<EdgeKey> edgeKeysRemoved,
+ Set<EdgeKey> edgeKeysAdded ) {
// I think this should be if there is ANY <w,z>->e' IN Eremove, then kill all <w,z>
// R' := (R - {<w,z>->e | <w,z>->e in R, A<w,z>->e' in R, e' notin Eremove}) U
// {<y,x>->e | e in E(x) x {f} x E(y)}
Set<EdgeKey> edgeKeysForLoad;
Set<EdgeKey> edgeKeysRemoved;
+ Set<EdgeKey> edgeKeysAdded;
//Stores the flatnode's reach graph at enter
ReachGraph rgOnEnter = new ReachGraph();
boolean strongUpdate = false;
edgeKeysRemoved = null;
+ edgeKeysAdded = null;
if( doDefiniteReachAnalysis ) {
edgeKeysRemoved = new HashSet<EdgeKey>();
+ edgeKeysAdded = new HashSet<EdgeKey>();
}
// before transfer func, possibly inject
if( shouldAnalysisTrack(fld.getType() ) ) {
// transfer func
- strongUpdate = rg.assignTempXFieldFEqualToTempY(lhs, fld, rhs, fn, edgeKeysRemoved);
-
+ strongUpdate = rg.assignTempXFieldFEqualToTempY( lhs,
+ fld,
+ rhs,
+ fn,
+ edgeKeysRemoved,
+ edgeKeysAdded );
if( doDefiniteReachAnalysis ) {
- definiteReachAnalysis.store( fn, lhs, fld, rhs, edgeKeysRemoved );
+ definiteReachAnalysis.store( fn,
+ lhs,
+ fld,
+ rhs,
+ edgeKeysRemoved,
+ edgeKeysAdded );
}
}
fdElement = getArrayField(tdElement);
edgeKeysRemoved = null;
+ edgeKeysAdded = null;
if( doDefiniteReachAnalysis ) {
edgeKeysRemoved = new HashSet<EdgeKey>();
+ edgeKeysAdded = new HashSet<EdgeKey>();
}
// before transfer func, possibly inject
// transfer func, BUT
// skip this node if it cannot create new reachability paths
if( !arrayReferencees.doesNotCreateNewReaching(fsen) ) {
- rg.assignTempXFieldFEqualToTempY(lhs, fdElement, rhs, fn, edgeKeysRemoved);
+ rg.assignTempXFieldFEqualToTempY( lhs,
+ fdElement,
+ rhs,
+ fn,
+ edgeKeysRemoved,
+ edgeKeysAdded );
}
if( doDefiniteReachAnalysis ) {
- definiteReachAnalysis.store( fn, lhs, fdElement, rhs, edgeKeysRemoved );
+ definiteReachAnalysis.store( fn,
+ lhs,
+ fdElement,
+ rhs,
+ edgeKeysRemoved,
+ edgeKeysAdded );
}
}
fdStringBytesField,
tdStrLiteralBytes,
null,
- null);
+ null,
+ null );
}
FieldDescriptor f,
TempDescriptor y,
FlatNode currentProgramPoint,
- Set<EdgeKey> edgeKeysRemoved
+ Set<EdgeKey> edgeKeysRemoved,
+ Set<EdgeKey> edgeKeysAdded
) {
VariableNode lnX = getVariableNodeFromTemp(x);
continue;
}
+ // for definite reach analysis only
+ if( edgeKeysAdded != null ) {
+ assert f != null;
+ edgeKeysAdded.add( new EdgeKey( hrnX.getID(),
+ hrnY.getID(),
+ f )
+ );
+ }
+
// prepare the new reference edge hrnX.f -> hrnY
TypeDescriptor tdNewEdge =
mostSpecificType(y.getType(),