Skip to content

Commit 438eac7

Browse files
authored
Merge branch 'main' into fix-go-extractor-package-exclusion
2 parents 692f25e + 7acd214 commit 438eac7

File tree

628 files changed

+35471
-20494
lines changed

Some content is hidden

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

628 files changed

+35471
-20494
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ members = [
1010
"rust/ast-generator",
1111
"rust/autobuild",
1212
]
13-
exclude = ["mad-generation-build"]

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ bazel_dep(name = "rules_go", version = "0.56.1")
1919
bazel_dep(name = "rules_pkg", version = "1.0.1")
2020
bazel_dep(name = "rules_nodejs", version = "6.2.0-codeql.1")
2121
bazel_dep(name = "rules_python", version = "0.40.0")
22-
bazel_dep(name = "rules_shell", version = "0.3.0")
23-
bazel_dep(name = "bazel_skylib", version = "1.7.1")
22+
bazel_dep(name = "rules_shell", version = "0.5.0")
23+
bazel_dep(name = "bazel_skylib", version = "1.8.1")
2424
bazel_dep(name = "abseil-cpp", version = "20240116.1", repo_name = "absl")
2525
bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json")
2626
bazel_dep(name = "fmt", version = "10.0.0")
2727
bazel_dep(name = "rules_kotlin", version = "2.1.3-codeql.1")
2828
bazel_dep(name = "gazelle", version = "0.40.0")
2929
bazel_dep(name = "rules_dotnet", version = "0.19.2-codeql.1")
3030
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
31-
bazel_dep(name = "rules_rust", version = "0.63.0")
31+
bazel_dep(name = "rules_rust", version = "0.66.0")
3232
bazel_dep(name = "zstd", version = "1.5.5.bcr.1")
3333

3434
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)

cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/EllipticCurveAlgorithmInstance.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class KnownOpenSslEllipticCurveConstantAlgorithmInstance extends OpenSslAlgorith
4040
result = this.(Call).getTarget().getName()
4141
}
4242

43-
override Crypto::EllipticCurveFamilyType getEllipticCurveFamilyType() {
43+
override Crypto::EllipticCurveType getEllipticCurveType() {
4444
if
4545
Crypto::ellipticCurveNameToKnownKeySizeAndFamilyMapping(this.getParsedEllipticCurveName(), _,
4646
_)

cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/HashAlgorithmInstance.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class KnownOpenSslHashConstantAlgorithmInstance extends OpenSslAlgorithmInstance
7272

7373
override OpenSslAlgorithmValueConsumer getAvc() { result = getterCall }
7474

75-
override Crypto::THashType getHashFamily() {
75+
override Crypto::THashType getHashType() {
7676
knownOpenSslConstantToHashFamilyType(this, result)
7777
or
7878
not knownOpenSslConstantToHashFamilyType(this, _) and result = Crypto::OtherHashType()

cpp/ql/lib/semmle/code/cpp/controlflow/IRGuards.qll

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,18 +380,20 @@ private module LogicInput_v1 implements GuardsImpl::LogicInputSig {
380380
GuardsInput::Expr getARead() { result = this.getAUse().getDef() }
381381
}
382382

383-
class SsaWriteDefinition extends SsaDefinition instanceof ExplicitDefinition {
384-
GuardsInput::Expr getDefinition() { result = super.getAssignedInstruction() }
383+
class SsaExplicitWrite extends SsaDefinition instanceof ExplicitDefinition {
384+
GuardsInput::Expr getValue() { result = super.getAssignedInstruction() }
385385
}
386386

387-
class SsaPhiNode extends SsaDefinition instanceof PhiNode {
387+
class SsaPhiDefinition extends SsaDefinition instanceof PhiNode {
388388
predicate hasInputFromBlock(SsaDefinition inp, BasicBlock bb) {
389389
super.hasInputFromBlock(inp, bb)
390390
}
391391
}
392392

393-
predicate parameterDefinition(GuardsInput::Parameter p, SsaDefinition def) {
394-
def.isParameterDefinition(p)
393+
class SsaParameterInit extends SsaDefinition {
394+
SsaParameterInit() { this.isParameterDefinition(_) }
395+
396+
GuardsInput::Parameter getParameter() { this.isParameterDefinition(result) }
395397
}
396398

397399
predicate additionalImpliesStep(

cpp/ql/test/library-tests/controlflow/guards/GuardsControl.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@
115115
| test.c:127:9:127:9 | 1 | not 0 | test.c:131:10:132:16 | { ... } |
116116
| test.c:131:7:131:7 | b | not 0 | test.c:131:10:132:16 | { ... } |
117117
| test.c:131:7:131:7 | b | true | test.c:131:10:132:16 | { ... } |
118-
| test.c:137:7:137:7 | 0 | 0 | test.c:142:3:136:10 | return ... |
119118
| test.c:137:7:137:7 | 0 | false | test.c:142:3:136:10 | return ... |
120119
| test.c:145:16:145:16 | x | 0 | test.c:146:11:147:9 | { ... } |
121120
| test.c:146:7:146:8 | ! ... | true | test.c:146:11:147:9 | { ... } |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: majorAnalysis
3+
---
4+
* The representation of the C# control-flow graph has been significantly changed. This has minor effects on a wide range of queries including both minor improvements and minor regressions, for example, improved precision has been observed for `cs/inefficient-containskey` and `cs/stringbuilder-creation-in-loop`. Two queries stand out as being significantly affected with great improvements: `cs/dereferenced-value-may-be-null` has been completely rewritten which removes a very significant number of false positives. Furthermore, `cs/constant-condition` has been updated to report many new results - these new results are primarily expected to be true positives, but a few new false positives are expected as well. As part of these changes, `cs/dereferenced-value-may-be-null` has been changed from a `path-problem` query to a `problem` query, so paths are no longer reported for this query.

csharp/ql/lib/semmle/code/csharp/controlflow/ControlFlowElement.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ class ControlFlowElement extends ExprOrStmtParent, @control_flow_element {
4040
*/
4141
Nodes::ElementNode getAControlFlowNode() { result.getAstNode() = this }
4242

43+
/** Gets the control flow node for this element. */
44+
ControlFlow::Node getControlFlowNode() { result.getAstNode() = this }
45+
46+
/** Gets the basic block in which this element occurs. */
47+
BasicBlock getBasicBlock() { result = this.getAControlFlowNode().getBasicBlock() }
48+
4349
/**
4450
* Gets a first control flow node executed within this element.
4551
*/

csharp/ql/lib/semmle/code/csharp/controlflow/ControlFlowGraph.qll

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,9 @@ module ControlFlow {
251251
}
252252
}
253253

254+
/** A control flow node indicating normal termination of a callable. */
255+
class NormalExitNode extends AnnotatedExitNode instanceof Impl::NormalExitNode { }
256+
254257
/** A node for a callable exit point. */
255258
class ExitNode extends Node instanceof Impl::ExitNode {
256259
/** Gets the callable that this exit applies to. */
@@ -292,13 +295,7 @@ module ControlFlow {
292295

293296
class Split = Splitting::Split;
294297

295-
class FinallySplit = Splitting::FinallySplitting::FinallySplit;
296-
297298
class ExceptionHandlerSplit = Splitting::ExceptionHandlerSplitting::ExceptionHandlerSplit;
298-
299-
class BooleanSplit = Splitting::BooleanSplitting::BooleanSplit;
300-
301-
class LoopSplit = Splitting::LoopSplitting::LoopSplit;
302299
}
303300

304301
class BasicBlock = BBs::BasicBlock;
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/**
2+
* Provides an implementation of local (intraprocedural) control flow reachability.
3+
*/
4+
5+
import csharp
6+
private import codeql.controlflow.ControlFlowReachability
7+
private import semmle.code.csharp.controlflow.BasicBlocks
8+
private import semmle.code.csharp.controlflow.Guards as Guards
9+
private import semmle.code.csharp.ExprOrStmtParent
10+
11+
private module ControlFlowInput implements
12+
InputSig<Location, ControlFlow::Node, ControlFlow::BasicBlock>
13+
{
14+
private import csharp as CS
15+
16+
AstNode getEnclosingAstNode(ControlFlow::Node node) {
17+
node.getAstNode() = result
18+
or
19+
not exists(node.getAstNode()) and result = node.getEnclosingCallable()
20+
}
21+
22+
class AstNode = ExprOrStmtParent;
23+
24+
AstNode getParent(AstNode node) { result = node.getParent() }
25+
26+
class FinallyBlock extends AstNode {
27+
FinallyBlock() { any(TryStmt try).getFinally() = this }
28+
}
29+
30+
class Expr = CS::Expr;
31+
32+
class SourceVariable = Ssa::SourceVariable;
33+
34+
class SsaDefinition = Ssa::Definition;
35+
36+
class SsaExplicitWrite extends SsaDefinition instanceof Ssa::ExplicitDefinition {
37+
Expr getValue() { result = super.getADefinition().getSource() }
38+
}
39+
40+
class SsaPhiDefinition = Ssa::PhiNode;
41+
42+
class SsaUncertainWrite = Ssa::UncertainDefinition;
43+
44+
class GuardValue = Guards::GuardValue;
45+
46+
predicate ssaControlsBranchEdge(SsaDefinition def, BasicBlock bb1, BasicBlock bb2, GuardValue v) {
47+
Guards::Guards::ssaControlsBranchEdge(def, bb1, bb2, v)
48+
}
49+
50+
predicate ssaControls(SsaDefinition def, BasicBlock bb, GuardValue v) {
51+
Guards::Guards::ssaControls(def, bb, v)
52+
}
53+
54+
import Guards::Guards::InternalUtil
55+
}
56+
57+
module ControlFlowReachability = Make<Location, Cfg, ControlFlowInput>;

0 commit comments

Comments
 (0)