-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dataflow: Add support for call context restrictions on sources/sinks. #6932
Conversation
Is it correct to conclude that this PR makes it possible to chain together multiple configurations without losing call the context (i.e., by using |
Short answer: No. |
|
||
/** A flow configuration feature for use in `Configuration::getAFeature()`. */ | ||
class FlowFeature extends TFlowFeature { | ||
abstract string toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No abstract predicates in user-visible classes.
* Implies both of the above and additionally ensures that the entire flow | ||
* path preserves the call context. | ||
*/ | ||
FlowFeature getAFeature() { none() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if fieldFlowBranchLimit
should also be made a feature (only trouble is, we would have to limit the possible values up-front).
sc instanceof SummaryCtxNone or | ||
cc instanceof CallContextNoCall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this logic warrants a comment.
@@ -3613,7 +3663,8 @@ private predicate pathIntoCallable( | |||
sc = TSummaryCtxSome(p, ap) | |||
or | |||
not exists(TSummaryCtxSome(p, ap)) and | |||
sc = TSummaryCtxNone() | |||
sc = TSummaryCtxNone() and | |||
not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice with a comment about why this is only relevant for FeatureEqualSourceSinkCallContext
.
49e7e35
to
6eabb61
Compare
This adds support for restricting the flow paths returned by the data flow library in 3 ways:
FeatureHasSourceCallContext
:Assume that sources have some existing call context to disallow
conflicting return-flow directly following the source.
FeatureHasSinkCallContext
:Assume that sinks have some existing call context to disallow
conflicting argument-to-parameter flow directly preceding the sink.
FeatureEqualSourceSinkCallContext
:Implies both of the above and additionally ensures that the entire flow
path preserves the call context.