-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Shared: Use sourceBoundedFastTC
in TypeTracking
#20370
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
Changes from all commits
fd7d216
3aee4a8
b7bc94b
f8bdf92
5a9b562
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -70,6 +70,10 @@ module TypeTracking<LocationSig Location, TypeTrackingInput<Location> I> { | |||
|
||||
private class ContentOption = ContentOption::Option; | ||||
|
||||
private predicate isLocalSourceNode(LocalSourceNode n) { | ||||
not nonStandardFlowsTo(_, _) and exists(n) | ||||
} | ||||
|
||||
cached | ||||
private module Cached { | ||||
cached | ||||
|
@@ -249,21 +253,9 @@ module TypeTracking<LocationSig Location, TypeTrackingInput<Location> I> { | |||
returnStep(nodeFrom, nodeTo) and summary = ReturnStep() | ||||
} | ||||
|
||||
pragma[inline] | ||||
private predicate isLocalSourceNode(LocalSourceNode n) { any() } | ||||
|
||||
cached | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it better to cache
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uh, that's a good idea. I didn't actually know that caching a |
||||
predicate standardFlowsTo(Node localSource, Node dst) { | ||||
not nonStandardFlowsTo(_, _) and | ||||
// explicit type check in base case to avoid repeated type tests in recursive case | ||||
isLocalSourceNode(localSource) and | ||||
dst = localSource | ||||
or | ||||
exists(Node mid | | ||||
standardFlowsTo(localSource, mid) and | ||||
simpleLocalSmallStep(mid, dst) | ||||
) | ||||
} | ||||
predicate simpleLocalSmallStepPlus(Node localSource, Node dst) = | ||||
sourceBoundedFastTC(simpleLocalSmallStep/2, isLocalSourceNode/1)(localSource, dst) | ||||
|
||||
cached | ||||
predicate stepNoCall(LocalSourceNode nodeFrom, LocalSourceNode nodeTo, StepSummary summary) { | ||||
|
@@ -276,6 +268,14 @@ module TypeTracking<LocationSig Location, TypeTrackingInput<Location> I> { | |||
} | ||||
} | ||||
|
||||
pragma[inline] | ||||
private predicate standardFlowsTo(Node localSource, Node dst) { | ||||
isLocalSourceNode(localSource) and | ||||
dst = localSource | ||||
or | ||||
simpleLocalSmallStepPlus(localSource, dst) | ||||
} | ||||
|
||||
import Cached | ||||
|
||||
/** | ||||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
This is a small helper forGah, never mind, it's of course also input to the TC.standardFlowsTo
. I think it should be moved down, so it appears directly beforestandardFlowsTo
. Also, check whether the RA is affected by manually inlining this - if not, then that simplifies things.