Skip to content
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

Swift: implement DataFlowDispatch for closures #9627

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rdmarsh2
Copy link
Contributor

@rdmarsh2 rdmarsh2 commented Jun 20, 2022

No description provided.

@rdmarsh2 rdmarsh2 requested a review from as a code owner Jun 20, 2022
@github-actions github-actions bot added the Swift label Jun 20, 2022
@rdmarsh2 rdmarsh2 force-pushed the rdmarsh2/swift/dataflow-dispatch-1 branch from 8144db3 to 7056db1 Compare Jun 20, 2022
@rdmarsh2 rdmarsh2 added the no-change-note-required label Jun 20, 2022

predicate bigStep(Node start, Node end) {
// TODO: restrict to interesting starts?
start = end
Copy link
Contributor

@MathiasVP MathiasVP Jun 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think this relation will be way too big as-is. If the compiler isn't adding any magic here, this is essentially the transitive closure of the entire local flow step relation.

I think we can avoid a bunch of this manual transitive closure stuff by instead implementing lambdaCreation and lambdaCall similar to how it's done in Ruby: https://github.com/github/codeql/blob/main/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll#L1084.

Copy link
Contributor Author

@rdmarsh2 rdmarsh2 Jun 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and implemented that, passing the same set of tests, but there's almost no overlap in the code. I've opened a separate PR: #9669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required Swift
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants