Skip to content

Commit c60df7d

Browse files
committed
Merge branch 'main' of github.com:github/codeql into python/support-match
2 parents b93c04b + 4632c14 commit c60df7d

File tree

72 files changed

+1313
-1332
lines changed

Some content is hidden

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

72 files changed

+1313
-1332
lines changed

.github/workflows/ruby-qltest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ jobs:
3232
- uses: ./ruby/actions/create-extractor-pack
3333
- name: Run QL tests
3434
run: |
35-
codeql test run --search-path "${{ github.workspace }}/ruby/extractor-pack" --check-databases --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --consistency-queries ql/consistency-queries ql/test
35+
codeql test run --threads=0 --ram 5000 --search-path "${{ github.workspace }}/ruby/extractor-pack" --check-databases --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --consistency-queries ql/consistency-queries ql/test
3636
env:
3737
GITHUB_TOKEN: ${{ github.token }}
3838
- name: Check QL formatting
3939
run: find ql "(" -name "*.ql" -or -name "*.qll" ")" -print0 | xargs -0 codeql query format --check-only
4040
- name: Check QL compilation
4141
run: |
42-
codeql query compile --check-only --threads=4 --warnings=error "ql/src" "ql/examples"
42+
codeql query compile --check-only --threads=0 --ram 5000 --warnings=error "ql/src" "ql/examples"
4343
env:
4444
GITHUB_TOKEN: ${{ github.token }}
4545
- name: Check DB upgrade scripts

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* An IR taint tracking library that uses an IR DataFlow configuration to track
3+
* taint from user inputs as defined by `semmle.code.cpp.security.Security`.
4+
*/
5+
16
import cpp
27
import semmle.code.cpp.security.Security
38
private import semmle.code.cpp.ir.dataflow.DataFlow

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,45 @@ private predicate hasDefaultSideEffect(Call call, ParameterIndex i, boolean buff
111111
)
112112
}
113113

114+
/**
115+
* A `Call` or `NewOrNewArrayExpr`.
116+
*
117+
* Both kinds of expression invoke a function as part of their evaluation. This class provides a
118+
* way to treat both kinds of function similarly, and to get the invoked `Function`.
119+
*/
120+
class CallOrAllocationExpr extends Expr {
121+
CallOrAllocationExpr() {
122+
this instanceof Call
123+
or
124+
this instanceof NewOrNewArrayExpr
125+
}
126+
127+
/** Gets the `Function` invoked by this expression, if known. */
128+
final Function getTarget() {
129+
result = this.(Call).getTarget()
130+
or
131+
result = this.(NewOrNewArrayExpr).getAllocator()
132+
}
133+
}
134+
135+
/**
136+
* Returns the side effect opcode, if any, that represents any side effects not specifically modeled
137+
* by an argument side effect.
138+
*/
139+
Opcode getCallSideEffectOpcode(CallOrAllocationExpr expr) {
140+
not exists(expr.getTarget().(SideEffectFunction)) and result instanceof Opcode::CallSideEffect
141+
or
142+
exists(SideEffectFunction sideEffectFunction |
143+
sideEffectFunction = expr.getTarget() and
144+
if not sideEffectFunction.hasOnlySpecificWriteSideEffects()
145+
then result instanceof Opcode::CallSideEffect
146+
else (
147+
not sideEffectFunction.hasOnlySpecificReadSideEffects() and
148+
result instanceof Opcode::CallReadSideEffect
149+
)
150+
)
151+
}
152+
114153
/**
115154
* Returns a side effect opcode for parameter index `i` of the specified call.
116155
*

0 commit comments

Comments
 (0)