Skip to content

Commit 61bf215

Browse files
authored
Merge branch 'main' into shared-http-client-request
2 parents 9790594 + 5840377 commit 61bf215

File tree

192 files changed

+10916
-1764
lines changed

Some content is hidden

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

192 files changed

+10916
-1764
lines changed

cpp/downgrades/f96ad9b2da43bbc9e55a72a165febd270ae07981/old.dbscheme

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

cpp/downgrades/f96ad9b2da43bbc9e55a72a165febd270ae07981/semmlecode.cpp.dbscheme

Lines changed: 2131 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
description: Add relation for orphaned local variables
2+
compatibility: full
3+
orphaned_variables.rel: delete

cpp/ql/lib/experimental/semmle/code/cpp/semantic/SemanticExprSpecific.qll

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,22 +292,20 @@ module SemanticExprConfig {
292292

293293
class Guard = IRGuards::IRGuardCondition;
294294

295-
predicate guard(Guard guard, BasicBlock block) {
296-
block = guard.(IRGuards::IRGuardCondition).getBlock()
297-
}
295+
predicate guard(Guard guard, BasicBlock block) { block = guard.getBlock() }
298296

299297
Expr getGuardAsExpr(Guard guard) { result = guard }
300298

301299
predicate equalityGuard(Guard guard, Expr e1, Expr e2, boolean polarity) {
302-
guard.(IRGuards::IRGuardCondition).comparesEq(e1.getAUse(), e2.getAUse(), 0, true, polarity)
300+
guard.comparesEq(e1.getAUse(), e2.getAUse(), 0, true, polarity)
303301
}
304302

305303
predicate guardDirectlyControlsBlock(Guard guard, BasicBlock controlled, boolean branch) {
306-
guard.(IRGuards::IRGuardCondition).controls(controlled, branch)
304+
guard.controls(controlled, branch)
307305
}
308306

309307
predicate guardHasBranchEdge(Guard guard, BasicBlock bb1, BasicBlock bb2, boolean branch) {
310-
guard.(IRGuards::IRGuardCondition).controlsEdge(bb1, bb2, branch)
308+
guard.controlsEdge(bb1, bb2, branch)
311309
}
312310

313311
Guard comparisonGuard(Expr e) { result = e }

cpp/ql/lib/semmle/code/cpp/File.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,6 @@ class Folder extends Container, @folder {
218218
class File extends Container, @file {
219219
override string getAbsolutePath() { files(underlyingElement(this), result) }
220220

221-
override string toString() { result = Container.super.toString() }
222-
223221
override string getAPrimaryQlClass() { result = "File" }
224222

225223
override Location getLocation() {

cpp/ql/lib/semmle/code/cpp/Variable.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@ class LocalVariable extends LocalScopeVariable, @localvariable {
398398
exists(DeclStmt s | s.getADeclaration() = this and s.getEnclosingFunction() = result)
399399
or
400400
exists(ConditionDeclExpr e | e.getVariable() = this and e.getEnclosingFunction() = result)
401+
or
402+
orphaned_variables(underlyingElement(this), unresolveElement(result))
401403
}
402404
}
403405

cpp/ql/lib/semmlecode.cpp.dbscheme

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,11 @@ autoderivation(
523523
int derivation_type: @type ref
524524
);
525525

526+
orphaned_variables(
527+
int var: @localvariable ref,
528+
int function: @function ref
529+
)
530+
526531
enumconstants(
527532
unique int id: @enumconstant,
528533
int parent: @usertype ref,

0 commit comments

Comments
 (0)