Skip to content

Commit 47af3a6

Browse files
committed
Merge branch 'main' of github.com:github/codeql into python/support-match
2 parents 32cbeae + 477f83c commit 47af3a6

File tree

635 files changed

+40914
-11196
lines changed

Some content is hidden

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

635 files changed

+40914
-11196
lines changed

config/identical-files.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl5.qll",
88
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl6.qll",
99
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForSerializability.qll",
10+
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForOnActivityResult.qll",
1011
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll",
1112
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll",
1213
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll",

cpp/ql/lib/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 0.0.7
2+
13
## 0.0.6
24

35
## 0.0.5
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## 0.0.7

cpp/ql/lib/codeql-pack.release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
lastReleaseVersion: 0.0.6
2+
lastReleaseVersion: 0.0.7

cpp/ql/lib/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/cpp-all
2-
version: 0.0.7-dev
2+
version: 0.0.8-dev
33
groups: cpp
44
dbscheme: semmlecode.cpp.dbscheme
55
extractor: cpp

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,7 @@ class Class extends UserType {
206206
* it is callable by a particular caller. For C++11, there's also a question
207207
* of whether to include members that are defaulted or deleted.
208208
*/
209-
deprecated predicate hasCopyConstructor() {
210-
exists(CopyConstructor cc | cc = this.getAMemberFunction())
211-
}
209+
deprecated predicate hasCopyConstructor() { this.getAMemberFunction() instanceof CopyConstructor }
212210

213211
/**
214212
* Holds if this class has a copy assignment operator that is either
@@ -224,7 +222,7 @@ class Class extends UserType {
224222
* or deleted.
225223
*/
226224
deprecated predicate hasCopyAssignmentOperator() {
227-
exists(CopyAssignmentOperator coa | coa = this.getAMemberFunction())
225+
this.getAMemberFunction() instanceof CopyAssignmentOperator
228226
}
229227

230228
/**
@@ -887,7 +885,7 @@ class NestedClass extends Class {
887885
* pure virtual function.
888886
*/
889887
class AbstractClass extends Class {
890-
AbstractClass() { exists(PureVirtualFunction f | this.getAMemberFunction() = f) }
888+
AbstractClass() { this.getAMemberFunction() instanceof PureVirtualFunction }
891889

892890
override string getAPrimaryQlClass() { result = "AbstractClass" }
893891
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,13 @@ class AttributeArgument extends Element, @attribute_arg {
286286
override Location getLocation() { attribute_args(underlyingElement(this), _, _, _, result) }
287287

288288
override string toString() {
289-
if exists(@attribute_arg_empty self | self = underlyingElement(this))
289+
if underlyingElement(this) instanceof @attribute_arg_empty
290290
then result = "empty argument"
291291
else
292292
exists(string prefix, string tail |
293293
(if exists(this.getName()) then prefix = this.getName() + "=" else prefix = "") and
294294
(
295-
if exists(@attribute_arg_type self | self = underlyingElement(this))
295+
if underlyingElement(this) instanceof @attribute_arg_type
296296
then tail = this.getValueType().getName()
297297
else tail = this.getValueText()
298298
) and

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class XMLElement extends @xmlelement, XMLParent, XMLLocatable {
233233
XMLAttribute getAttribute(string name) { result.getElement() = this and result.getName() = name }
234234

235235
/** Holds if this XML element has an attribute with the specified `name`. */
236-
predicate hasAttribute(string name) { exists(XMLAttribute a | a = this.getAttribute(name)) }
236+
predicate hasAttribute(string name) { exists(this.getAttribute(name)) }
237237

238238
/** Gets the value of the attribute with the specified `name`, if any. */
239239
string getAttributeValue(string name) { result = this.getAttribute(name).getValue() }

cpp/ql/lib/semmle/code/cpp/commons/Printf.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ class FormatLiteral extends Literal {
11221122
* conversion specifier of this format string; has no result if this cannot
11231123
* be determined.
11241124
*/
1125-
int getMaxConvertedLength(int n) { result = max(getMaxConvertedLength(n, _)) }
1125+
int getMaxConvertedLength(int n) { result = max(this.getMaxConvertedLength(n, _)) }
11261126

11271127
/**
11281128
* Gets the maximum length of the string that can be produced by the nth
@@ -1353,7 +1353,7 @@ class FormatLiteral extends Literal {
13531353
* determining whether a buffer overflow is caused by long float to string
13541354
* conversions.
13551355
*/
1356-
int getMaxConvertedLengthLimited(int n) { result = max(getMaxConvertedLengthLimited(n, _)) }
1356+
int getMaxConvertedLengthLimited(int n) { result = max(this.getMaxConvertedLengthLimited(n, _)) }
13571357

13581358
/**
13591359
* Gets the maximum length of the string that can be produced by the nth

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class GuardCondition extends Expr {
2929
exists(IRGuardCondition ir | this = ir.getUnconvertedResultExpression())
3030
or
3131
// no binary operators in the IR
32-
exists(GuardCondition gc | this.(BinaryLogicalOperation).getAnOperand() = gc)
32+
this.(BinaryLogicalOperation).getAnOperand() instanceof GuardCondition
3333
or
3434
// the IR short-circuits if(!x)
3535
// don't produce a guard condition for `y = !x` and other non-short-circuited cases
@@ -98,7 +98,7 @@ class GuardCondition extends Expr {
9898
*/
9999
private class GuardConditionFromBinaryLogicalOperator extends GuardCondition {
100100
GuardConditionFromBinaryLogicalOperator() {
101-
exists(GuardCondition gc | this.(BinaryLogicalOperation).getAnOperand() = gc)
101+
this.(BinaryLogicalOperation).getAnOperand() instanceof GuardCondition
102102
}
103103

104104
override predicate controls(BasicBlock controlled, boolean testIsTrue) {

0 commit comments

Comments
 (0)