Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public abstract class AnalysisPolicy {
protected final int maxObjectSetSize;
protected final boolean hybridStaticContext;
protected final boolean useConservativeUnsafeAccess;
private final int parsingContextMaxDepth;
private final boolean trackAccessChain;

public AnalysisPolicy(OptionValues options) {
this.options = options;
Expand All @@ -84,6 +86,8 @@ public AnalysisPolicy(OptionValues options) {
maxObjectSetSize = PointstoOptions.MaxObjectSetSize.getValue(options);
hybridStaticContext = PointstoOptions.HybridStaticContext.getValue(options);
useConservativeUnsafeAccess = PointstoOptions.UseConservativeUnsafeAccess.getValue(options);
trackAccessChain = PointstoOptions.TrackAccessChain.getValue(options);
parsingContextMaxDepth = PointstoOptions.ParsingContextMaxDepth.getValue(options);
}

public abstract boolean isContextSensitiveAnalysis();
Expand Down Expand Up @@ -124,6 +128,14 @@ public boolean useConservativeUnsafeAccess() {
return useConservativeUnsafeAccess;
}

public boolean trackAccessChain() {
return trackAccessChain;
}

public int parsingContextMaxDepth() {
return parsingContextMaxDepth;
}

public abstract MethodTypeFlow createMethodTypeFlow(PointsToAnalysisMethod method);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,8 @@ public void registerUnsafeStore(UnsafeStoreTypeFlow unsafeStore) {
/**
* Force update of the unsafe loads and unsafe store type flows when a field is registered as
* unsafe accessed 'on the fly', i.e., during the analysis.
*
* @param field the newly unsafe registered field. We use its declaring type to filter the
* unsafe access flows that need to be updated.
*/
public void forceUnsafeUpdate(AnalysisField field) {
public void forceUnsafeUpdate() {
if (analysisPolicy.useConservativeUnsafeAccess()) {
return;
}
Expand All @@ -239,7 +236,7 @@ public void forceUnsafeUpdate(AnalysisField field) {
* update; an update of the receiver object flow will trigger an updated of the
* observers, i.e., of the unsafe load.
*/
if (unsafeLoad.receiver().isFlowEnabled()) {
if (unsafeLoad.receiver().isActive()) {
this.postFlow(unsafeLoad.receiver());
}
}
Expand All @@ -254,7 +251,7 @@ public void forceUnsafeUpdate(AnalysisField field) {
* update; an update of the receiver object flow will trigger an updated of the
* observers, i.e., of the unsafe store.
*/
if (unsafeStore.receiver().isFlowEnabled()) {
if (unsafeStore.receiver().isActive()) {
this.postFlow(unsafeStore.receiver());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public TypeFlow<BytecodePosition> copy(PointsToAnalysis bb, MethodFlowsGraph met

@Override
public void initFlow(PointsToAnalysis bb) {
assert !bb.usePredicates() || newTypeFlow.getPredicate() != null || MethodFlowsGraph.nonMethodFlow(newTypeFlow) : "Missing predicate for the flow " + newTypeFlow + ", which is input for " +
this;
assert !bb.usePredicates() || newTypeFlow.getPredicate() != null || MethodFlowsGraph.nonMethodFlow(newTypeFlow) || newTypeFlow.isFlowEnabled() : "Missing predicate for the flow " +
newTypeFlow + ", which is input for " + this;
newTypeFlow.addObserver(bb, this);
}

Expand Down
Loading
Loading