X Tutup
The Wayback Machine - https://web.archive.org/web/20220526183930/https://github.com/github/codeql/pull/9275
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: Add shared dataflow library #9275

Merged
merged 3 commits into from May 24, 2022
Merged

Conversation

MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented May 23, 2022

The first two commits are 100% bitwise copies from the internal repo. We can't yet add any tests since we don't extract Swift comments yet, and therefore cannot yet use the inline expectations test framework.

@MathiasVP MathiasVP requested a review from as a code owner May 23, 2022
@github-actions github-actions bot added the Swift label May 23, 2022
@MathiasVP MathiasVP added the no-change-note-required label May 23, 2022

override predicate allowImplicitRead(DataFlow::Node node, DataFlow::ContentSet c) {
(this.isSink(node) or this.isAdditionalTaintStep(node, _)) and
defaultImplicitTaintRead(node, c)

Check warning on line 166 in swift/ql/lib/codeql/swift/dataflow/internal/tainttracking1/TaintTrackingImpl.qll

Code scanning

QL-for-QL encountered an internal consistency error Warning

PredConsistency::noResolveCall
predicate variableWrite(BasicBlock bb, int i, SourceVariable v, boolean certain) {
exists(AssignExpr assign |
bb.getNode(i).getNode() = assign and
assign.getDest() = v.getAnAccess() and

Check warning on line 20 in swift/ql/lib/codeql/swift/dataflow/internal/SsaImplSpecific.qll

Code scanning

QL-for-QL encountered an internal consistency error Warning

PredConsistency::noResolveCall
BarrierGuard() { none() }

/** Holds if this guard controls block `b` upon evaluating to `branch`. */
private predicate controlsBlock(BasicBlock bb, boolean branch) { none() }

Check warning on line 129 in swift/ql/lib/codeql/swift/dataflow/internal/DataFlowPublic.qll

Code scanning

Dead code Warning

Code is dead
predicate localFlowStepImpl(Node nodeFrom, Node nodeTo) { none() }

cached
newtype TContentSet = TODO_TContentSet()

Check warning on line 46 in swift/ql/lib/codeql/swift/dataflow/internal/DataFlowPrivate.qll

Code scanning

Dead code Warning

Code is dead
/**
* The cost limits for the `AccessPathFront` to `AccessPathApprox` expansion.
*
* `apLimit` bounds the acceptable fan-out, and `tupleLimit` bounds the
* estimated per-`AccessPathFront` tuple cost. Access paths exceeding both of
* these limits are represented with lower precision during pruning.
*/

Check warning on line 58 in swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplCommon.qll

Code scanning

Predicate QLDoc style. Warning

The QLDoc for a predicate without a result should start with 'Holds'.
/**
* The cost limits for the `AccessPathApprox` to `AccessPath` expansion.
*
* `apLimit` bounds the acceptable fan-out, and `tupleLimit` bounds the
* estimated per-`AccessPathApprox` tuple cost. Access paths exceeding both of
* these limits are represented with lower precision.
*/

Check warning on line 70 in swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplCommon.qll

Code scanning

Predicate QLDoc style. Warning

The QLDoc for a predicate without a result should start with 'Holds'.
@MathiasVP MathiasVP requested a review from rdmarsh2 May 24, 2022
@MathiasVP
Copy link
Contributor Author

@MathiasVP MathiasVP commented May 24, 2022

The Code Scanning alerts are all either:

  • In shared files (which I don't want to change in this PR), or
  • Caused by the fact that this is currently dead code.

@rdmarsh2 rdmarsh2 merged commit 8cc509e into github:main May 24, 2022
26 of 27 checks passed
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
X Tutup