Skip to content

Commit 0536d4b

Browse files
authored
Merge branch 'main' into ruby/activejob-deserialize
2 parents 3d08a29 + 87af5b7 commit 0536d4b

File tree

399 files changed

+3899
-1407
lines changed

Some content is hidden

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

399 files changed

+3899
-1407
lines changed

.github/workflows/qhelp-pr-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
id: changes
5353
run: |
5454
(git diff -z --name-only --diff-filter=ACMRT HEAD~1 HEAD | grep -z '.qhelp$' | grep -z -v '.inc.qhelp';
55-
git diff -z --name-only --diff-filter=ACMRT HEAD~1 HEAD | grep -z '.inc.qhelp$' | xargs --null -rn1 basename | xargs --null -rn1 git grep -z -l) |
55+
git diff -z --name-only --diff-filter=ACMRT HEAD~1 HEAD | grep -z '.inc.qhelp$' | xargs --null -rn1 basename -z | xargs --null -rn1 git grep -z -l) |
5656
grep -z '.qhelp$' | grep -z -v '^-' | sort -z -u > "${RUNNER_TEMP}/paths.txt"
5757
5858
- name: QHelp preview

config/identical-files.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
"python/ql/lib/semmle/python/dataflow/new/internal/tainttracking3/TaintTrackingImpl.qll",
7171
"python/ql/lib/semmle/python/dataflow/new/internal/tainttracking4/TaintTrackingImpl.qll",
7272
"ruby/ql/lib/codeql/ruby/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
73-
"ruby/ql/lib/codeql/ruby/dataflow/internal/tainttrackingforregexp/TaintTrackingImpl.qll",
7473
"swift/ql/lib/codeql/swift/dataflow/internal/tainttracking1/TaintTrackingImpl.qll"
7574
],
7675
"DataFlow Java/C++/C#/Python Consistency checks": [

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ abstract class Configuration extends string {
163163
/**
164164
* Holds if data may flow from some source to `sink` for this configuration.
165165
*/
166-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
166+
predicate hasFlowTo(Node sink) {
167+
sink = any(PathNodeSink n | this = n.getConfiguration()).getNodeEx().asNode()
168+
}
167169

168170
/**
169171
* Holds if data may flow from some source to `sink` for this configuration.
@@ -2925,12 +2927,17 @@ abstract private class PathNodeImpl extends PathNode {
29252927
result = this.getASuccessorImpl()
29262928
}
29272929

2928-
final PathNodeImpl getANonHiddenSuccessor() {
2929-
result = this.getASuccessorImpl().getASuccessorIfHidden*() and
2930-
not this.isHidden() and
2930+
pragma[nomagic]
2931+
private PathNodeImpl getANonHiddenSuccessor0() {
2932+
result = this.getASuccessorIfHidden*() and
29312933
not result.isHidden()
29322934
}
29332935

2936+
final PathNodeImpl getANonHiddenSuccessor() {
2937+
result = this.getASuccessorImpl().getANonHiddenSuccessor0() and
2938+
not this.isHidden()
2939+
}
2940+
29342941
abstract NodeEx getNodeEx();
29352942

29362943
predicate isHidden() {

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ abstract class Configuration extends string {
163163
/**
164164
* Holds if data may flow from some source to `sink` for this configuration.
165165
*/
166-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
166+
predicate hasFlowTo(Node sink) {
167+
sink = any(PathNodeSink n | this = n.getConfiguration()).getNodeEx().asNode()
168+
}
167169

168170
/**
169171
* Holds if data may flow from some source to `sink` for this configuration.
@@ -2925,12 +2927,17 @@ abstract private class PathNodeImpl extends PathNode {
29252927
result = this.getASuccessorImpl()
29262928
}
29272929

2928-
final PathNodeImpl getANonHiddenSuccessor() {
2929-
result = this.getASuccessorImpl().getASuccessorIfHidden*() and
2930-
not this.isHidden() and
2930+
pragma[nomagic]
2931+
private PathNodeImpl getANonHiddenSuccessor0() {
2932+
result = this.getASuccessorIfHidden*() and
29312933
not result.isHidden()
29322934
}
29332935

2936+
final PathNodeImpl getANonHiddenSuccessor() {
2937+
result = this.getASuccessorImpl().getANonHiddenSuccessor0() and
2938+
not this.isHidden()
2939+
}
2940+
29342941
abstract NodeEx getNodeEx();
29352942

29362943
predicate isHidden() {

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ abstract class Configuration extends string {
163163
/**
164164
* Holds if data may flow from some source to `sink` for this configuration.
165165
*/
166-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
166+
predicate hasFlowTo(Node sink) {
167+
sink = any(PathNodeSink n | this = n.getConfiguration()).getNodeEx().asNode()
168+
}
167169

168170
/**
169171
* Holds if data may flow from some source to `sink` for this configuration.
@@ -2925,12 +2927,17 @@ abstract private class PathNodeImpl extends PathNode {
29252927
result = this.getASuccessorImpl()
29262928
}
29272929

2928-
final PathNodeImpl getANonHiddenSuccessor() {
2929-
result = this.getASuccessorImpl().getASuccessorIfHidden*() and
2930-
not this.isHidden() and
2930+
pragma[nomagic]
2931+
private PathNodeImpl getANonHiddenSuccessor0() {
2932+
result = this.getASuccessorIfHidden*() and
29312933
not result.isHidden()
29322934
}
29332935

2936+
final PathNodeImpl getANonHiddenSuccessor() {
2937+
result = this.getASuccessorImpl().getANonHiddenSuccessor0() and
2938+
not this.isHidden()
2939+
}
2940+
29342941
abstract NodeEx getNodeEx();
29352942

29362943
predicate isHidden() {

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ abstract class Configuration extends string {
163163
/**
164164
* Holds if data may flow from some source to `sink` for this configuration.
165165
*/
166-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
166+
predicate hasFlowTo(Node sink) {
167+
sink = any(PathNodeSink n | this = n.getConfiguration()).getNodeEx().asNode()
168+
}
167169

168170
/**
169171
* Holds if data may flow from some source to `sink` for this configuration.
@@ -2925,12 +2927,17 @@ abstract private class PathNodeImpl extends PathNode {
29252927
result = this.getASuccessorImpl()
29262928
}
29272929

2928-
final PathNodeImpl getANonHiddenSuccessor() {
2929-
result = this.getASuccessorImpl().getASuccessorIfHidden*() and
2930-
not this.isHidden() and
2930+
pragma[nomagic]
2931+
private PathNodeImpl getANonHiddenSuccessor0() {
2932+
result = this.getASuccessorIfHidden*() and
29312933
not result.isHidden()
29322934
}
29332935

2936+
final PathNodeImpl getANonHiddenSuccessor() {
2937+
result = this.getASuccessorImpl().getANonHiddenSuccessor0() and
2938+
not this.isHidden()
2939+
}
2940+
29342941
abstract NodeEx getNodeEx();
29352942

29362943
predicate isHidden() {

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private newtype TReturnKind =
137137
exists(IndirectReturnNode return, ReturnIndirectionInstruction returnInd |
138138
returnInd.hasIndex(argumentIndex) and
139139
return.getAddressOperand() = returnInd.getSourceAddressOperand() and
140-
indirectionIndex = return.getIndirectionIndex() - 1 // We subtract one because the return loads the value.
140+
indirectionIndex = return.getIndirectionIndex()
141141
)
142142
}
143143

@@ -197,7 +197,7 @@ class ReturnIndirectionNode extends IndirectReturnNode, ReturnNode {
197197
exists(int argumentIndex, ReturnIndirectionInstruction returnInd |
198198
returnInd.hasIndex(argumentIndex) and
199199
this.getAddressOperand() = returnInd.getSourceAddressOperand() and
200-
result = TIndirectReturnKind(argumentIndex, this.getIndirectionIndex() - 1) and
200+
result = TIndirectReturnKind(argumentIndex, this.getIndirectionIndex()) and
201201
hasNonInitializeParameterDef(returnInd.getIRVariable())
202202
)
203203
or
@@ -365,7 +365,7 @@ predicate jumpStep(Node n1, Node n2) {
365365
predicate storeStep(Node node1, Content c, PostFieldUpdateNode node2) {
366366
exists(int indirectionIndex1, int numberOfLoads, StoreInstruction store |
367367
nodeHasInstruction(node1, store, pragma[only_bind_into](indirectionIndex1)) and
368-
node2.getIndirectionIndex() = 0 and
368+
node2.getIndirectionIndex() = 1 and
369369
numberOfLoadsFromOperand(node2.getFieldAddress(), store.getDestinationAddressOperand(),
370370
numberOfLoads)
371371
|
@@ -465,20 +465,20 @@ predicate clearsContent(Node n, Content c) {
465465
predicate expectsContent(Node n, ContentSet c) { none() }
466466

467467
/** Gets the type of `n` used for type pruning. */
468-
IRType getNodeType(Node n) {
468+
DataFlowType getNodeType(Node n) {
469469
suppressUnusedNode(n) and
470-
result instanceof IRVoidType // stub implementation
470+
result instanceof VoidType // stub implementation
471471
}
472472

473473
/** Gets a string representation of a type returned by `getNodeType`. */
474-
string ppReprType(IRType t) { none() } // stub implementation
474+
string ppReprType(DataFlowType t) { none() } // stub implementation
475475

476476
/**
477477
* Holds if `t1` and `t2` are compatible, that is, whether data can flow from
478478
* a node of type `t1` to a node of type `t2`.
479479
*/
480480
pragma[inline]
481-
predicate compatibleTypes(IRType t1, IRType t2) {
481+
predicate compatibleTypes(DataFlowType t1, DataFlowType t2) {
482482
any() // stub implementation
483483
}
484484

@@ -502,7 +502,7 @@ class DataFlowCallable = Cpp::Declaration;
502502

503503
class DataFlowExpr = Expr;
504504

505-
class DataFlowType = IRType;
505+
class DataFlowType = Type;
506506

507507
/** A function call relevant for data flow. */
508508
class DataFlowCall extends CallInstruction {

0 commit comments

Comments
 (0)