Skip to content

Commit 6b14c1d

Browse files
committed
Merge branch 'main' into jorgectf/python/deserialization
2 parents 5552834 + cbe3964 commit 6b14c1d

File tree

152 files changed

+43757
-39710
lines changed

Some content is hidden

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

152 files changed

+43757
-39710
lines changed

.github/workflows/ruby-qltest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
qltest:
6464
runs-on: ubuntu-latest
6565
strategy:
66+
fail-fast: false
6667
matrix:
6768
slice: ["1/2", "2/2"]
6869
steps:

cpp/ql/lib/semmle/code/cpp/ir/dataflow/DefaultTaintTracking.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ private module Cached {
241241
// For compatibility, send flow from arguments to parameters, even for
242242
// functions with no body.
243243
exists(FunctionCall call, int i |
244-
sink.asExpr() = call.getArgument(i) and
245-
result = resolveCall(call).getParameter(i)
244+
sink.asExpr() = call.getArgument(pragma[only_bind_into](i)) and
245+
result = resolveCall(call).getParameter(pragma[only_bind_into](i))
246246
)
247247
or
248248
// For compatibility, send flow into a `Variable` if there is flow to any

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/internal/ValueNumberingInternal.qll

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ private predicate filteredNumberableInstruction(Instruction instr) {
106106
or
107107
instr instanceof FieldAddressInstruction and
108108
count(instr.(FieldAddressInstruction).getField()) != 1
109+
or
110+
instr instanceof InheritanceConversionInstruction and
111+
(
112+
count(instr.(InheritanceConversionInstruction).getBaseClass()) != 1 or
113+
count(instr.(InheritanceConversionInstruction).getDerivedClass()) != 1
114+
)
109115
}
110116

111117
private predicate variableAddressValueNumber(
@@ -115,8 +121,7 @@ private predicate variableAddressValueNumber(
115121
// The underlying AST element is used as value-numbering key instead of the
116122
// `IRVariable` to work around a problem where a variable or expression with
117123
// multiple types gives rise to multiple `IRVariable`s.
118-
instr.getIRVariable().getAST() = ast and
119-
strictcount(instr.getIRVariable().getAST()) = 1
124+
unique( | | instr.getIRVariable().getAST()) = ast
120125
}
121126

122127
private predicate initializeParameterValueNumber(
@@ -133,8 +138,7 @@ private predicate constantValueNumber(
133138
ConstantInstruction instr, IRFunction irFunc, IRType type, string value
134139
) {
135140
instr.getEnclosingIRFunction() = irFunc and
136-
strictcount(instr.getResultIRType()) = 1 and
137-
instr.getResultIRType() = type and
141+
unique( | | instr.getResultIRType()) = type and
138142
instr.getValue() = value
139143
}
140144

@@ -151,8 +155,7 @@ private predicate fieldAddressValueNumber(
151155
TValueNumber objectAddress
152156
) {
153157
instr.getEnclosingIRFunction() = irFunc and
154-
instr.getField() = field and
155-
strictcount(instr.getField()) = 1 and
158+
unique( | | instr.getField()) = field and
156159
tvalueNumber(instr.getObjectAddress()) = objectAddress
157160
}
158161

@@ -195,9 +198,9 @@ private predicate inheritanceConversionValueNumber(
195198
) {
196199
instr.getEnclosingIRFunction() = irFunc and
197200
instr.getOpcode() = opcode and
198-
instr.getBaseClass() = baseClass and
199-
instr.getDerivedClass() = derivedClass and
200-
tvalueNumber(instr.getUnary()) = operand
201+
tvalueNumber(instr.getUnary()) = operand and
202+
unique( | | instr.getBaseClass()) = baseClass and
203+
unique( | | instr.getDerivedClass()) = derivedClass
201204
}
202205

203206
private predicate loadTotalOverlapValueNumber(

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ private predicate filteredNumberableInstruction(Instruction instr) {
106106
or
107107
instr instanceof FieldAddressInstruction and
108108
count(instr.(FieldAddressInstruction).getField()) != 1
109+
or
110+
instr instanceof InheritanceConversionInstruction and
111+
(
112+
count(instr.(InheritanceConversionInstruction).getBaseClass()) != 1 or
113+
count(instr.(InheritanceConversionInstruction).getDerivedClass()) != 1
114+
)
109115
}
110116

111117
private predicate variableAddressValueNumber(
@@ -115,8 +121,7 @@ private predicate variableAddressValueNumber(
115121
// The underlying AST element is used as value-numbering key instead of the
116122
// `IRVariable` to work around a problem where a variable or expression with
117123
// multiple types gives rise to multiple `IRVariable`s.
118-
instr.getIRVariable().getAST() = ast and
119-
strictcount(instr.getIRVariable().getAST()) = 1
124+
unique( | | instr.getIRVariable().getAST()) = ast
120125
}
121126

122127
private predicate initializeParameterValueNumber(
@@ -133,8 +138,7 @@ private predicate constantValueNumber(
133138
ConstantInstruction instr, IRFunction irFunc, IRType type, string value
134139
) {
135140
instr.getEnclosingIRFunction() = irFunc and
136-
strictcount(instr.getResultIRType()) = 1 and
137-
instr.getResultIRType() = type and
141+
unique( | | instr.getResultIRType()) = type and
138142
instr.getValue() = value
139143
}
140144

@@ -151,8 +155,7 @@ private predicate fieldAddressValueNumber(
151155
TValueNumber objectAddress
152156
) {
153157
instr.getEnclosingIRFunction() = irFunc and
154-
instr.getField() = field and
155-
strictcount(instr.getField()) = 1 and
158+
unique( | | instr.getField()) = field and
156159
tvalueNumber(instr.getObjectAddress()) = objectAddress
157160
}
158161

@@ -195,9 +198,9 @@ private predicate inheritanceConversionValueNumber(
195198
) {
196199
instr.getEnclosingIRFunction() = irFunc and
197200
instr.getOpcode() = opcode and
198-
instr.getBaseClass() = baseClass and
199-
instr.getDerivedClass() = derivedClass and
200-
tvalueNumber(instr.getUnary()) = operand
201+
tvalueNumber(instr.getUnary()) = operand and
202+
unique( | | instr.getBaseClass()) = baseClass and
203+
unique( | | instr.getDerivedClass()) = derivedClass
201204
}
202205

203206
private predicate loadTotalOverlapValueNumber(

cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingInternal.qll

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ private predicate filteredNumberableInstruction(Instruction instr) {
106106
or
107107
instr instanceof FieldAddressInstruction and
108108
count(instr.(FieldAddressInstruction).getField()) != 1
109+
or
110+
instr instanceof InheritanceConversionInstruction and
111+
(
112+
count(instr.(InheritanceConversionInstruction).getBaseClass()) != 1 or
113+
count(instr.(InheritanceConversionInstruction).getDerivedClass()) != 1
114+
)
109115
}
110116

111117
private predicate variableAddressValueNumber(
@@ -115,8 +121,7 @@ private predicate variableAddressValueNumber(
115121
// The underlying AST element is used as value-numbering key instead of the
116122
// `IRVariable` to work around a problem where a variable or expression with
117123
// multiple types gives rise to multiple `IRVariable`s.
118-
instr.getIRVariable().getAST() = ast and
119-
strictcount(instr.getIRVariable().getAST()) = 1
124+
unique( | | instr.getIRVariable().getAST()) = ast
120125
}
121126

122127
private predicate initializeParameterValueNumber(
@@ -133,8 +138,7 @@ private predicate constantValueNumber(
133138
ConstantInstruction instr, IRFunction irFunc, IRType type, string value
134139
) {
135140
instr.getEnclosingIRFunction() = irFunc and
136-
strictcount(instr.getResultIRType()) = 1 and
137-
instr.getResultIRType() = type and
141+
unique( | | instr.getResultIRType()) = type and
138142
instr.getValue() = value
139143
}
140144

@@ -151,8 +155,7 @@ private predicate fieldAddressValueNumber(
151155
TValueNumber objectAddress
152156
) {
153157
instr.getEnclosingIRFunction() = irFunc and
154-
instr.getField() = field and
155-
strictcount(instr.getField()) = 1 and
158+
unique( | | instr.getField()) = field and
156159
tvalueNumber(instr.getObjectAddress()) = objectAddress
157160
}
158161

@@ -195,9 +198,9 @@ private predicate inheritanceConversionValueNumber(
195198
) {
196199
instr.getEnclosingIRFunction() = irFunc and
197200
instr.getOpcode() = opcode and
198-
instr.getBaseClass() = baseClass and
199-
instr.getDerivedClass() = derivedClass and
200-
tvalueNumber(instr.getUnary()) = operand
201+
tvalueNumber(instr.getUnary()) = operand and
202+
unique( | | instr.getBaseClass()) = baseClass and
203+
unique( | | instr.getDerivedClass()) = derivedClass
201204
}
202205

203206
private predicate loadTotalOverlapValueNumber(

0 commit comments

Comments
 (0)