Skip to content

Commit f8a3ce7

Browse files
Merge branch 'main' into jeongsoolee09/add-getIndirectionIndex
2 parents d3066af + d52e9bc commit f8a3ce7

File tree

166 files changed

+362
-281
lines changed

Some content is hidden

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

166 files changed

+362
-281
lines changed

config/add-overlay-annotations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ def annotate_as_appropriate(filename, lines):
199199
# as overlay[local?]. It is not clear that these heuristics are exactly what we want,
200200
# but they seem to work well enough for now (as determined by speed and accuracy numbers).
201201
if (filename.endswith("Test.qll") or
202+
re.search(r"go/ql/lib/semmle/go/security/[^/]+[.]qll$", filename.replace(os.sep, "/")) or
202203
((filename.endswith("Query.qll") or filename.endswith("Config.qll")) and
203204
any("implements DataFlow::ConfigSig" in line for line in lines))):
204205
return None
Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,5 @@
11
import csharp
22
import semmle.code.csharp.controlflow.internal.Completion
3-
import semmle.code.csharp.controlflow.internal.PreBasicBlocks
43
import ControlFlow
54
import semmle.code.csharp.controlflow.internal.ControlFlowGraphImpl::Consistency
65
import semmle.code.csharp.controlflow.internal.Splitting
7-
8-
private predicate splitBB(ControlFlow::BasicBlock bb) {
9-
exists(ControlFlow::Node first |
10-
first = bb.getFirstNode() and
11-
first.isJoin() and
12-
strictcount(first.getAPredecessor().getAstNode()) = 1
13-
)
14-
}
15-
16-
private class RelevantBasicBlock extends ControlFlow::BasicBlock {
17-
RelevantBasicBlock() { not splitBB(this) }
18-
}
19-
20-
predicate bbStartInconsistency(ControlFlowElement cfe) {
21-
exists(RelevantBasicBlock bb | bb.getFirstNode() = cfe.getAControlFlowNode()) and
22-
not cfe = any(PreBasicBlock bb).getFirstElement()
23-
}
24-
25-
predicate bbSuccInconsistency(ControlFlowElement pred, ControlFlowElement succ) {
26-
exists(RelevantBasicBlock predBB, RelevantBasicBlock succBB |
27-
predBB.getLastNode() = pred.getAControlFlowNode() and
28-
succBB = predBB.getASuccessor() and
29-
succBB.getFirstNode() = succ.getAControlFlowNode()
30-
) and
31-
not exists(PreBasicBlock predBB, PreBasicBlock succBB |
32-
predBB.getLastNode() = pred and
33-
succBB = predBB.getASuccessor() and
34-
succBB.getFirstElement() = succ
35-
)
36-
}
37-
38-
predicate bbIntraSuccInconsistency(ControlFlowElement pred, ControlFlowElement succ) {
39-
exists(ControlFlow::BasicBlock bb, int i |
40-
pred.getAControlFlowNode() = bb.getNode(i) and
41-
succ.getAControlFlowNode() = bb.getNode(i + 1)
42-
) and
43-
not exists(PreBasicBlock bb |
44-
bb.getLastNode() = pred and
45-
bb.getASuccessor().getFirstElement() = succ
46-
) and
47-
not exists(PreBasicBlock bb, int i |
48-
bb.getNode(i) = pred and
49-
bb.getNode(i + 1) = succ
50-
)
51-
}
52-
53-
query predicate preBasicBlockConsistency(ControlFlowElement cfe1, ControlFlowElement cfe2, string s) {
54-
bbStartInconsistency(cfe1) and
55-
cfe2 = cfe1 and
56-
s = "start inconsistency"
57-
or
58-
bbSuccInconsistency(cfe1, cfe2) and
59-
s = "succ inconsistency"
60-
or
61-
bbIntraSuccInconsistency(cfe1, cfe2) and
62-
s = "intra succ inconsistency"
63-
}

csharp/ql/lib/semmle/code/csharp/controlflow/internal/PreBasicBlocks.qll

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

go/extractor/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ toolchain go1.26.0
99
// when adding or removing dependencies, run
1010
// bazel mod tidy
1111
require (
12-
golang.org/x/mod v0.33.0
13-
golang.org/x/tools v0.42.0
12+
golang.org/x/mod v0.34.0
13+
golang.org/x/tools v0.43.0
1414
)
1515

1616
require github.com/stretchr/testify v1.11.1
1717

1818
require (
1919
github.com/davecgh/go-spew v1.1.1 // indirect
2020
github.com/pmezard/go-difflib v1.0.0 // indirect
21-
golang.org/x/sync v0.19.0 // indirect
21+
golang.org/x/sync v0.20.0 // indirect
2222
gopkg.in/yaml.v3 v3.0.1 // indirect
2323
)

go/extractor/go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
66
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
77
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
88
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
9-
golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8=
10-
golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=
11-
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
12-
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
13-
golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k=
14-
golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0=
9+
golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI=
10+
golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY=
11+
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
12+
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
13+
golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s=
14+
golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0=
1515
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1616
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1717
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

go/ql/lib/Customizations.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@
88
* `FileSystemAccess`, or the `Source` and `Sink` classes associated with the security queries
99
* to model frameworks that are not covered by the standard library.
1010
*/
11+
overlay[local?]
12+
module;
1113

1214
import go

go/ql/lib/go.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
22
* Provides classes for working with Go programs.
33
*/
4+
overlay[local?]
5+
module;
46

57
import Customizations
68
import semmle.go.Architectures

go/ql/lib/ideContextual.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Provides classes and predicates related to contextual queries
33
* in the code viewer.
44
*/
5+
overlay[local?]
6+
module;
57

68
import go
79
private import codeql.util.FileSystem

go/ql/lib/semmle/go/AST.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
22
* Provides classes for working with AST nodes.
33
*/
4+
overlay[local]
5+
module;
46

57
import go
68

go/ql/lib/semmle/go/Architectures.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/** Provides classes for working with architectures. */
2+
overlay[local]
3+
module;
24

35
import go
46

0 commit comments

Comments
 (0)