Skip to content

Commit d605060

Browse files
authored
Merge branch 'main' into redsun82/cargo-upgrade-3
2 parents 84d4e3f + a702f7a commit d605060

File tree

19 files changed

+16188
-5580
lines changed

19 files changed

+16188
-5580
lines changed

cpp/downgrades/9baef67d1ffc1551429dbe1c1130815693e28218/old.dbscheme

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

cpp/downgrades/9baef67d1ffc1551429dbe1c1130815693e28218/semmlecode.cpp.dbscheme

Lines changed: 2494 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 a predicate `getAnAttribute` to `Namespace`
2+
compatibility: full
3+
namespaceattributes.rel: delete
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: feature
3+
---
4+
* Added a predicate `getAnAttribute` to `Namespace` to retrieve a namespace attribute.

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ class Namespace extends NameQualifyingElement, @namespace {
9999

100100
/** Gets a file which declares (part of) this namespace. */
101101
File getAFile() { result = this.getADeclarationEntry().getLocation().getFile() }
102+
103+
/** Gets an attribute of this namespace. */
104+
Attribute getAnAttribute() {
105+
namespaceattributes(underlyingElement(this), unresolveElement(result))
106+
}
102107
}
103108

104109
/**

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedCall.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ private import semmle.code.cpp.ir.implementation.internal.OperandTag
44
private import semmle.code.cpp.ir.internal.CppType
55
private import semmle.code.cpp.models.interfaces.SideEffect
66
private import semmle.code.cpp.models.interfaces.Throwing
7+
private import semmle.code.cpp.models.interfaces.NonThrowing
78
private import InstructionTag
89
private import SideEffects
910
private import TranslatedElement
@@ -366,6 +367,10 @@ class TranslatedFunctionCall extends TranslatedCallExpr, TranslatedDirectCall {
366367
or
367368
exists(MicrosoftTryStmt tryStmt | tryStmt.getStmt() = expr.getEnclosingStmt().getParent*()) and
368369
e instanceof SehExceptionEdge
370+
or
371+
not expr.getTarget() instanceof NonCppThrowingFunction and
372+
exists(TryStmt tryStmt | tryStmt.getStmt() = expr.getEnclosingStmt().getParent*()) and
373+
e instanceof CppExceptionEdge
369374
}
370375

371376
final override predicate mustThrowException(ExceptionEdge e) {

cpp/ql/lib/semmlecode.cpp.dbscheme

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,11 @@ varattributes(
11391139
int spec_id: @attribute ref
11401140
);
11411141

1142+
namespaceattributes(
1143+
int namespace_id: @namespace ref,
1144+
int spec_id: @attribute ref
1145+
);
1146+
11421147
stmtattributes(
11431148
int stmt_id: @stmt ref,
11441149
int spec_id: @attribute ref

0 commit comments

Comments
 (0)