Skip to content

Commit eca9ec5

Browse files
committed
Add exclusions to data flow consistency checks
1 parent a2e6848 commit eca9ec5

File tree

198 files changed

+15
-1471519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+15
-1471519
lines changed

go/ql/lib/semmle/go/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ private import TaintTrackingImplSpecific
99
private import codeql.dataflow.internal.DataFlowImplConsistency
1010
private import semmle.go.dataflow.internal.DataFlowNodes
1111

12-
private module Input implements InputSig<Location, Impl::GoDataFlow> { }
12+
private module Input implements InputSig<Location, Impl::GoDataFlow> {
13+
predicate missingLocationExclude(DataFlow::Node n) {
14+
n instanceof DataFlow::GlobalFunctionNode or n instanceof Private::FlowSummaryNode
15+
}
16+
17+
predicate uniqueNodeLocationExclude(DataFlow::Node n) { missingLocationExclude(n) }
18+
19+
predicate localFlowIsLocalExclude(DataFlow::Node n1, DataFlow::Node n2) {
20+
n1 instanceof DataFlow::FunctionNode and exists(n2)
21+
}
22+
23+
predicate argHasPostUpdateExclude(DataFlow::ArgumentNode n) {
24+
not DataFlow::insnHasPostUpdateNode(n.asInstruction())
25+
}
26+
}
1327

1428
module Consistency = MakeConsistency<Location, Impl::GoDataFlow, GoTaintTracking, Input>;

go/ql/test/consistency/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 21 deletions
This file was deleted.

go/ql/test/example-tests/snippets/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 13912 deletions
Large diffs are not rendered by default.

go/ql/test/experimental/CWE-090/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 14033 deletions
This file was deleted.

go/ql/test/experimental/CWE-1004/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 15488 deletions
This file was deleted.

go/ql/test/experimental/CWE-203/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 13941 deletions
Large diffs are not rendered by default.

go/ql/test/experimental/CWE-285/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)