Compare commits

...

484 Commits

Author SHA1 Message Date
Nick Rolfe
ff54dfe8aa Merge pull request #20112 from github/release-prep/2.22.2
Release preparation for version 2.22.2
2025-07-23 05:40:18 -04:00
Nick Rolfe
2c03d1f14a Tweak changenotes 2025-07-23 10:38:57 +01:00
github-actions[bot]
26296c44d3 Release preparation for version 2.22.2 2025-07-23 09:32:53 +00:00
Nick Rolfe
a883db0935 Merge pull request #20110 from github/revert-20105-release-prep/2.22.2
Revert "Release preparation for version 2.22.2"
2025-07-23 05:30:33 -04:00
Nick Rolfe
12ebf717eb Revert "Release preparation for version 2.22.2" 2025-07-23 10:09:23 +01:00
Nick Rolfe
320f75fa51 Merge pull request #20105 from github/release-prep/2.22.2
Release preparation for version 2.22.2
2025-07-22 10:11:13 -04:00
Nick Rolfe
43d14c28c2 Tweak changenotes 2025-07-22 15:06:09 +01:00
github-actions[bot]
997547b8ef Release preparation for version 2.22.2 2025-07-22 14:04:14 +00:00
Nick Rolfe
5fb7541a94 Merge pull request #20104 from github/revert-20100-release-prep/2.22.2
Revert "Release preparation for version 2.22.2"
2025-07-22 10:01:12 -04:00
Nick Rolfe
825c813095 Revert "Release preparation for version 2.22.2" 2025-07-22 14:33:45 +01:00
Nick Rolfe
0b7111b867 Merge pull request #20100 from github/release-prep/2.22.2
Release preparation for version 2.22.2
2025-07-22 04:55:58 -04:00
Nick Rolfe
74cd982aca Tweak changenotes 2025-07-22 09:51:52 +01:00
github-actions[bot]
c8632b70b7 Release preparation for version 2.22.2 2025-07-21 16:45:45 +00:00
Nick Rolfe
05572b49de Merge pull request #20099 from github/nickrolfe/revert-2.22.2-prep
Revert post-release preparation for codeql-cli-2.22.2
2025-07-21 10:58:49 -04:00
Nick Rolfe
ad9b637bec Revert "Merge pull request #19994 from github/post-release-prep/codeql-cli-2.22.2"
This reverts commit e5b4a15e35, reversing
changes made to 33e63109bb.
2025-07-21 15:18:59 +01:00
Simon Friis Vindum
ad5c5acae5 Merge pull request #20094 from paldepind/rust/type-inference-path-mention
Rust: Refactor `PathTypeMention`
2025-07-21 14:00:20 +02:00
Owen Mansel-Chan
472a6b5fe1 Merge pull request #20018 from owen-mc/java/snakeyaml-safe-unsafe-deserialization
Java: Update qhelp: SnakeYaml is safe from version 2.0
2025-07-21 12:22:36 +01:00
Anders Schack-Mulligen
d5cdfc673e Merge pull request #20092 from aschackmull/java/joinorder2
Java: Improve more join-orders
2025-07-21 11:27:14 +02:00
Nora Dimitrijević
fbee6bbe21 Merge pull request #20077 from d10c/d10c/diff-informed-phase-3-java
Java: Diff-informed queries: phase 3 (non-trivial locations)
2025-07-21 11:23:12 +02:00
Anders Schack-Mulligen
937e3dc469 Merge pull request #20091 from aschackmull/java/fix-cfg-cp-assert
Java: Fix accidental CP in CFG for asserts.
2025-07-21 09:07:19 +02:00
Simon Friis Vindum
441cefd0bd Rust: Accept test changes 2025-07-21 08:34:16 +02:00
Simon Friis Vindum
27e5251285 Rust: Add resolveRootType predicate instead of using resolveType recursively 2025-07-19 13:57:31 +02:00
Simon Friis Vindum
804ffdb682 Rust: Split PathTypeMention into an alias and a non-alias subclass 2025-07-19 13:43:56 +02:00
Simon Friis Vindum
0e8c137a98 Rust: Only include paths as type mentions when they're used as such
On databend this changes the number of `PathTypeMention`s from 3,777,464 to 3,330,024. Not a huge difference, but there's also downstream predicates that are reduced as well.
2025-07-19 11:57:13 +02:00
Simon Friis Vindum
620d228ffa Rust: Factor out getTypeMentionForTypeParameter 2025-07-19 08:41:38 +02:00
Anders Schack-Mulligen
46ebf503c7 Java: Improve join-order by controlling magic and breaking up TCs. 2025-07-18 16:13:11 +02:00
Anders Schack-Mulligen
ca8fe033d7 Java: Improve join by preventing ssa use-pair join. 2025-07-18 16:12:00 +02:00
Anders Schack-Mulligen
d64a9368d2 Merge pull request #20088 from aschackmull/java/joinorders1
Java: Improve several join-orders
2025-07-18 14:54:26 +02:00
Anders Schack-Mulligen
bc2e7d4e0d Java: Fix accidental CP in CFG for asserts. 2025-07-18 13:53:15 +02:00
Anders Schack-Mulligen
f6975117fe Merge pull request #20083 from aschackmull/java/prune-csrf-unprotected-request-type
Java: Prune PathGraph for CsrfUnprotectedRequestType.ql
2025-07-18 13:25:00 +02:00
Anders Schack-Mulligen
d9f47bdec9 Java: Improve join-order by properly annotating haveIntersection. 2025-07-18 11:48:50 +02:00
Anders Schack-Mulligen
7883124abd Java: getSourceDeclaration() and getASourceSupertype*() commute and this yields much better join-order. 2025-07-18 11:47:14 +02:00
Anders Schack-Mulligen
12732525b5 Java: Allow 2-column join on delta to improve join-order. 2025-07-18 11:45:45 +02:00
Michael Nebel
ededa3c006 Merge pull request #20087 from github/workflow/coverage/update
Update CSV framework coverage reports
2025-07-18 08:34:04 +02:00
github-actions[bot]
2f84a4a5b5 Add changed framework coverage reports 2025-07-18 00:25:03 +00:00
Nora Dimitrijević
05df1d3cb9 [DIFF-INFORMED] Java: AndroidWebViewSettingsAllowsContentAccess 2025-07-17 19:02:15 +02:00
Nora Dimitrijević
24c28ed873 [DIFF-INFORMED] Java: UnsafeCertTrust
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-273/UnsafeCertTrust.ql#L21
2025-07-17 19:02:13 +02:00
Nora Dimitrijević
ea4af8323c [DIFF-INFORMED] Java: TrustBoundaryViolation
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-501/TrustBoundaryViolation.ql#L18
2025-07-17 19:02:09 +02:00
Nora Dimitrijević
7888dcbce2 [DIFF-INFORMED] Java: TempDirLocalInformationDisclosure
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure.ql#L56
2025-07-17 19:02:07 +02:00
Nora Dimitrijević
3785dbec9e [DIFF-INFORMED] Java: TaintedEnvironmentVariable
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-078/ExecTaintedEnvironment.ql#L22
2025-07-17 19:02:05 +02:00
Nora Dimitrijević
b3b139bb02 [DIFF-INFORMED] Java: SqlConcatenated
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-089/SqlConcatenated.ql#L27
2025-07-17 19:02:04 +02:00
Nora Dimitrijević
45b627df1d [DIFF-INFORMED] Java: SensitiveLogging
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-532/SensitiveInfoLog.ql#L20
2025-07-17 19:02:02 +02:00
Nora Dimitrijević
bc0b383595 [DIFF-INFORMED] Java: MaybeBrokenCryptoAlgorithm
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-327/MaybeBrokenCryptoAlgorithm.ql#L25
2025-07-17 19:02:00 +02:00
Nora Dimitrijević
b688df9dec [DIFF-INFORMED] Java: LogInjection
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-117/LogInjection.ql#L20
2025-07-17 19:01:58 +02:00
Nora Dimitrijević
2d734056b1 [DIFF-INFORMED] Java: InsecureLdapAuth
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-522/InsecureLdapAuth.ql#L21
2025-07-17 19:01:56 +02:00
Nora Dimitrijević
74b37e71a0 [DIFF-INFORMED] Java: InsecureCookie
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-614/InsecureCookie.ql#L21
2025-07-17 19:01:52 +02:00
Nora Dimitrijević
19e5c3d805 [DIFF-INFORMED] Java: ImproperValidationOfArray…
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayIndexCodeSpecified.ql#L48
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayConstructionCodeSpecified.ql#L28
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayConstruction.ql#L26
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayIndex.ql#L24
2025-07-17 19:01:50 +02:00
Nora Dimitrijević
919fea53f0 [DIFF-INFORMED] Java: ExternallyControlledFormatString
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-134/ExternallyControlledFormatString.ql#L24
2025-07-17 19:01:34 +02:00
Nora Dimitrijević
1c6ecf1216 [DIFF-INFORMED] Java: UntrustedDataToExternalAPI
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-020/UntrustedDataToExternalAPI.ql#L20
2025-07-17 18:59:15 +02:00
Nora Dimitrijević
0cf1195678 [DIFF-INFORMED] Java: ConditionalBypass
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-807/ConditionalBypass.ql#L26
2025-07-17 18:59:14 +02:00
Nora Dimitrijević
0bcdb421ed [DIFF-INFORMED] Java: ArithmeticUncontrolled
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql#L36
2025-07-17 18:59:11 +02:00
Nora Dimitrijević
54546f6e99 [DIFF-INFORMED] Java: ArithmeticTainted
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-190/ArithmeticTainted.ql#L35
2025-07-17 18:59:09 +02:00
Nora Dimitrijević
8353fdd041 [DIFF-INFORMED] Java: (Android)SensitiveCommunication
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/java/ql/src/Security/CWE/CWE-927/SensitiveCommunication.ql#L20
2025-07-17 18:59:06 +02:00
Nora Dimitrijević
b33058c967 [TEST] Java: SensitiveCommunication: convert to qlref 2025-07-17 18:59:05 +02:00
Nora Dimitrijević
44bb5e7220 [TEST] Java: ConditionalBypass: convert to qlref 2025-07-17 18:59:03 +02:00
Nora Dimitrijević
6134518d60 [TEST] Java: SensitiveLogInfo: convert to qlref 2025-07-17 18:59:01 +02:00
Nora Dimitrijević
94386f0550 [TEST] Java: TrustBoundaryViolations: convert test to qlref 2025-07-17 18:58:59 +02:00
Nora Dimitrijević
49e03b4dfd [TEST] Java: UnsafeCertTrust: convert test to qlref 2025-07-17 18:58:56 +02:00
Nora Dimitrijević
7aced48443 [TEST] Java: LogInjection: convert test to qlref 2025-07-17 18:58:54 +02:00
Nora Dimitrijević
5c2cf79785 [TEST] Java: CWE-020/ExternalAPI: new test based on qhelp 2025-07-17 18:58:52 +02:00
Anders Schack-Mulligen
996de78a66 Java: Prune PathGraph for CsrfUnprotectedRequestType.ql 2025-07-17 15:06:38 +02:00
Anders Schack-Mulligen
1485d7072d Merge pull request #19885 from aschackmull/java/annotated-exit-cfg
Java: Add AnnotatedExitNodes to the CFG.
2025-07-17 15:02:24 +02:00
Michael Nebel
2f29459cda Merge pull request #19931 from michaelnebel/ql4ql/qualitytagcheck
Ql4ql: Quality query tagging.
2025-07-17 14:53:14 +02:00
Idriss Riouak
36ebe99f2f Merge pull request #19707 from microsoft/lwsimpkins/fix-qhelp-upstream
fix qhelp files
2025-07-17 14:51:01 +02:00
Owen Mansel-Chan
af977e9ac7 Merge pull request #20067 from owen-mc/java/unsafe-deserialization-mad-sinks
Java: allow the definition of `java/unsafe-deserialization` sinks using data extensions
2025-07-17 13:42:31 +01:00
Kasper Svendsen
a807db52ad Merge pull request #19872 from github/kaspersv/overlay-java-enable
Overlay: Enable overlay compilation for Java
2025-07-17 14:38:17 +02:00
Jeroen Ketema
acc66c7b58 Merge pull request #19984 from jketema/jketema/sec-shared
Make a proper shared library out of the concept related libraries
2025-07-17 13:25:33 +02:00
Owen Mansel-Chan
6629bd8279 No need to deprecate classes when module is deprecated 2025-07-17 11:52:31 +01:00
Owen Mansel-Chan
b361f76643 Delete unused private class 2025-07-17 11:36:06 +01:00
Anders Schack-Mulligen
448cc82ef9 Kotlin: Accept more test changes. 2025-07-17 11:21:27 +02:00
Anders Schack-Mulligen
54775e0958 Java: Adjust Paths.qll 2025-07-17 11:21:26 +02:00
Anders Schack-Mulligen
e7a6259bd7 Java: Accept test changes. 2025-07-17 11:21:26 +02:00
Anders Schack-Mulligen
fbe79e8a52 Java: Add AnnotatedExitNodes to the CFG. 2025-07-17 11:21:26 +02:00
Owen Mansel-Chan
53e1939b60 Merge pull request #20053 from owen-mc/go/fix-dataflowconsistency
Go: Fix compilation of DataFlowImplConsistency.qll
2025-07-17 09:22:12 +01:00
Michael Nebel
01738c2e42 Merge pull request #19940 from michaelnebel/csharp/fixmodels
C#: Improve some existing manual models.
2025-07-17 07:58:14 +02:00
Jeroen Ketema
eabe651edf Merge pull request #20069 from jketema/spaceship-ir
C++: Support the spaceship operator in the IR
2025-07-16 21:45:39 +02:00
Jeroen Ketema
29a6af4efd C++: Fix instruction class name 2025-07-16 18:11:17 +02:00
Jeroen Ketema
f319381f27 C++: Support the spaceship operator in the IR 2025-07-16 17:53:55 +02:00
Jeroen Ketema
9b8302f983 Merge pull request #20068 from jketema/spaceship-test
C++: Add test that shows that IR generation for `<=>` is broken
2025-07-16 16:50:25 +02:00
Owen Mansel-Chan
805e31fdb9 Update test expectations 2025-07-16 15:25:45 +01:00
Jeroen Ketema
807ab986f4 C++: Update more exoected test results 2025-07-16 16:19:40 +02:00
Mathias Vorreiter Pedersen
a9fb49a2c3 Merge pull request #20066 from MathiasVP/dont-summarize-function-pointer-calls
C++: Don't wrap calls through function pointers in `FunctionWithWrappers`
2025-07-16 14:57:14 +01:00
Jeroen Ketema
2709bf0615 C++: Add test that shows that IR generation for <=> is broken 2025-07-16 15:54:18 +02:00
Owen Mansel-Chan
7d4a70cc1d Add change notes 2025-07-16 14:44:24 +01:00
Owen Mansel-Chan
ad60aff860 Update which sink kinds are shared between languages 2025-07-16 14:42:12 +01:00
Owen Mansel-Chan
fdd1e3fefe Use MaD models for unsafe deserialization sinks when possible
Many of the unsafe deserialization sinks have to stay defined in QL
because they have custom logic that cannot be expressed in MaD models.
2025-07-16 14:42:07 +01:00
Mathias Vorreiter Pedersen
8b953e4f22 C++: No need for 'resolveCall' anymore. 2025-07-16 14:28:04 +01:00
Mathias Vorreiter Pedersen
df4b338c5d C++: Add change notes. 2025-07-16 14:11:09 +01:00
Jeroen Ketema
1990438376 JS: Fix import
The import should not have been private, because we want users to still be
able to import this file and have access to the crypto algorithms.
2025-07-16 14:41:50 +02:00
Jeroen Ketema
24bea738c9 Shared: Add missing QLDoc and change note 2025-07-16 14:37:43 +02:00
Mathias Vorreiter Pedersen
ca913b452c C++: Don't summarize calls through function pointers in FunctionWithWrappers. 2025-07-16 11:51:46 +01:00
Jeroen Ketema
200d46f5c7 Merge pull request #20060 from jketema/typeid-fix
C++: Fix typeid IR translation
2025-07-16 12:40:03 +02:00
Michael Nebel
e9fdca7d39 C#: Address review comments. 2025-07-16 11:12:25 +02:00
Chris Smowton
d6a3b2e91f Merge pull request #20065 from smowton/smowton/fix/web.config
C#: Make web.config match case insensitive (with change note)
2025-07-16 09:52:34 +01:00
Michael Nebel
c5357ff556 Merge pull request #20008 from Hug0Vincent/csharp
feat: add getASupertype() predicate in ValueOrRefType.
2025-07-16 10:39:57 +02:00
Chris Smowton
a537c0091e change note 2025-07-16 09:06:38 +01:00
Geoffrey White
d264fb5865 Merge pull request #20042 from geoffw0/sinknoise
Rust: Make rust/summary/query-sinks less noisy
2025-07-16 08:36:16 +01:00
Michael Nebel
70bf61dc57 C#: Convert Deserialization tests to use inline expectations. 2025-07-16 08:41:58 +02:00
Michael Nebel
8f8b0428ab C#: Add change-note. 2025-07-16 08:41:56 +02:00
Michael Nebel
eba901f610 C#: Update flow summaries expected output. 2025-07-16 08:41:55 +02:00
Michael Nebel
95763dd225 C#: Add some models for SerializationInto and SerializationInfoEnumerator. 2025-07-16 08:41:53 +02:00
Michael Nebel
5c05ff843a C#: Improve the models for System.Text.Encoding.[GetBytes|GetChars]. 2025-07-16 08:41:52 +02:00
Michael Nebel
064c4fca12 C#: Add models for the remaining overloads of System.Xml.XmlDictionaryReader.CreateBinaryReader. 2025-07-16 08:41:50 +02:00
Michael Nebel
3ae69d5f3d C#: Promote the generated System.Xml.XmlDictionaryReader.CreateBinaryReader models to manual models. 2025-07-16 08:41:49 +02:00
Michael Nebel
8ee16f68a7 C#: Update test expected output. 2025-07-16 08:41:48 +02:00
Michael Nebel
13b40bbab4 C#: Fix erroneous model the MemoryStream constructor (and align with the other models). 2025-07-16 08:41:46 +02:00
Michael Nebel
4036140f4b C#: Add Deserialize testcase. 2025-07-16 08:41:45 +02:00
Hugo
8c82405b5b Update 2025-06-10-getasupertype.md 2025-07-16 00:35:30 +02:00
Hugo
6384cf2e4f Update predicate name 2025-07-16 00:35:14 +02:00
Jeroen Ketema
529712122c C++: Address review comments 2025-07-15 22:15:11 +02:00
James Frank
b9acaa0cbd Make web.config match case insensitive 2025-07-15 15:34:42 -04:00
Jeroen Ketema
a08d594371 C++: Introduce TypeidInstruction base class 2025-07-15 21:31:24 +02:00
Jeroen Ketema
58aa7588e5 Merge pull request #20059 from MathiasVP/no-more-as-expr-inUncontrolledProcessOperation
C++: Reduce duplication in `cpp/uncontrolled-process-operation`
2025-07-15 21:17:08 +02:00
Jeroen Ketema
54f11ca611 C++: Fix typo in comment 2025-07-15 20:40:57 +02:00
Jeroen Ketema
70bff4e726 C++: Fix typeid IR translation 2025-07-15 20:24:17 +02:00
Chris Smowton
16f3fc6c33 Merge pull request #20056 from github/smowton/fix/tainted-path-is-local
Golang: Mark filepath.IsLocal as a tainted-path sanitizer guard
2025-07-15 17:40:07 +01:00
Mathias Vorreiter Pedersen
327c4b345d Merge pull request #20058 from jketema/typeid-test
C++: Add test showing that the IR translation for `typeid` is broken
2025-07-15 16:55:16 +01:00
Chris Smowton
b71f9ae240 Fix function qname 2025-07-15 16:37:30 +01:00
Jeroen Ketema
477edd215c C++: Add test showing that the IR translation for typeid is broken 2025-07-15 17:29:00 +02:00
Owen Mansel-Chan
9ef22fff8e Update SnakeYaml reference to note that it is outdated 2025-07-15 15:27:01 +01:00
Kasper Svendsen
10a678dcbd Java lib qlpack: Enable overlay compilation 2025-07-15 16:23:40 +02:00
Kasper Svendsen
9c3e275e66 Merge pull request #20011 from kaspersv/kaspersv/discard-xml
Overlay: Add XML and Java property discarding
2025-07-15 16:13:38 +02:00
Chris Smowton
ac72f8523a Change note 2025-07-15 14:51:19 +01:00
Chris Smowton
c8eefb7c5c Golang: Mark filepath.IsLocal as a tainted-path sanitizer guard 2025-07-15 14:47:17 +01:00
Kasper Svendsen
f84a3084f0 Address review comment about ignored QL variable
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2025-07-15 15:34:08 +02:00
Anders Schack-Mulligen
b13f11883c Merge pull request #20054 from aschackmull/java/fixup-control-char-query
Java: Restrict results to source literals.
2025-07-15 15:28:46 +02:00
Anders Schack-Mulligen
9e87095bed Java: Restrict results to source literals. 2025-07-15 14:54:02 +02:00
Owen Mansel-Chan
9661ee407f Fix compilation of DataFlowImplConsistency.qll 2025-07-15 13:51:45 +01:00
Nick Rolfe
16e9e8e836 Merge pull request #20049 from github/nickrolfe/java-deleted-files
Java: use `overlayChangedFiles` in discard prediactes
2025-07-15 07:42:54 -04:00
Nick Rolfe
c199d0cbbe Java: use overlayChangedFiles in discard prediactes 2025-07-15 10:10:32 +01:00
Mathias Vorreiter Pedersen
29cceeba1a C++: Don't use asExpr to mark the sink in 'cpp/uncontrolled-process-operation'. 2025-07-14 18:08:58 +01:00
Jeroen Ketema
2ed54d52ad Merge pull request #20040 from MathiasVP/fix-global-variable-recursion-fp
C++: Fix global variable dataflow FP
2025-07-14 18:59:34 +02:00
Geoffrey White
26dae8144c Rust: Make rust/summary/query-sinks less noisy and thus more useful. This is the one in the DCA meta queries output, not the grand total used in metrics. 2025-07-14 17:26:43 +01:00
Jeroen Ketema
d33cd71685 Merge pull request #20030 from github/tausbn/javascript-ignore-tsconfig-outdirs-that-exclude-everything
JavaScript: Ignore `outDir`s that would exclude everything
2025-07-14 17:36:30 +02:00
Paolo Tranquilli
85d1e06335 Merge pull request #20039 from github/redsun82/kotlin-plugin-test
Kotlin: tweak plugin test
2025-07-14 17:20:27 +02:00
Mathias Vorreiter Pedersen
c83895fdd2 Merge branch 'main' into fix-global-variable-recursion-fp 2025-07-14 16:08:46 +01:00
Mathias Vorreiter Pedersen
1d36405084 C++: Accept path changes. 2025-07-14 15:47:06 +01:00
Jeroen Ketema
199587095a Add overlay annotations 2025-07-14 16:31:04 +02:00
Jeroen Ketema
cbde11ddc9 Properly share ConceptsShared.qll 2025-07-14 16:30:45 +02:00
Mathias Vorreiter Pedersen
a825213c05 C++: Fix FP by not generating a global def entry node for variable 'v' in the 'IRfunction' for 'v' itself. 2025-07-14 15:22:52 +01:00
Mathias Vorreiter Pedersen
46627c677d C++: Add FP in dataflow through global variables. 2025-07-14 15:20:08 +01:00
Simon Friis Vindum
87a8dccf7a Merge pull request #20037 from paldepind/rust/type-inference-rename-expectations
Rust: Rename type inference test inline expectation tag
2025-07-14 15:54:18 +02:00
Paolo Tranquilli
31d0897f74 Kotlin: disable bazel cache in plugin test 2025-07-14 15:30:11 +02:00
Nick Rolfe
c941e917e7 Merge pull request #19731 from github/nickrolfe/ruby-compile-for-overlay-eval
Ruby: enable overlay compilation
2025-07-14 08:20:28 -04:00
Simon Friis Vindum
72854537f4 Merge branch 'main' into rust/type-inference-rename-expectations 2025-07-14 14:15:59 +02:00
Paolo Tranquilli
77cab9d068 Kotlin: tweak plugin test
Put less emphasis on plugin build isolation, to get a better DevEx out
of it. The crux of the test is the database extraction part, not the
plugin build.
2025-07-14 13:52:22 +02:00
Geoffrey White
b43a0e758b Merge pull request #19946 from geoffw0/models3b
Rust: Update legacy MaD models 3
2025-07-14 11:19:47 +01:00
Geoffrey White
be7db8079a Rust: Accept consistency check change (from CI). 2025-07-14 10:59:03 +01:00
Ian Lynagh
86ebf3d9f6 Merge pull request #20034 from github/igfoo/fix_regex_in_dbscheme_parser
Kotlin: Update regex patterns to use raw string notation
2025-07-14 10:43:45 +01:00
Jeroen Ketema
f07d8ee493 Remove duplicate copies of CryptoAlgorithms and CryptoAlgorithmNames 2025-07-14 11:39:06 +02:00
Jeroen Ketema
f4ba2e1fd0 Properly share CryptoAlgorithms and CryptoAlgorithmNames 2025-07-14 11:39:00 +02:00
Jeroen Ketema
c582a9ccd6 Remove duplicate copies of SensitiveDataHeuristics 2025-07-14 11:38:52 +02:00
Jeroen Ketema
8b828cecf1 Use shared SensitiveDataHeuristics 2025-07-14 11:38:47 +02:00
Jeroen Ketema
01ee3f7011 Shared: Add shared concepts library 2025-07-14 11:38:39 +02:00
Michael B. Gale
27f2000eff Merge pull request #20035 from github/dependabot/go_modules/go/extractor/extractor-dependencies-5538d87460
Bump golang.org/x/tools from 0.34.0 to 0.35.0 in /go/extractor in the extractor-dependencies group
2025-07-14 10:12:38 +01:00
Simon Friis Vindum
1f2e0683e7 Rust: Rename type inference test inline expectation tag 2025-07-14 11:02:22 +02:00
Napalys Klicius
cb6978063e Merge pull request #19388 from AdnaneKhan/patch-1
Actions: Fix Critical Artifact poisoning False Positive
2025-07-14 09:58:18 +02:00
dependabot[bot]
c267a88f88 Bump golang.org/x/tools
---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-version: 0.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: extractor-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-14 03:37:24 +00:00
Ian Lynagh
a6701ced8d Kotlin: Update regex patterns to use raw string notation
Fixes warnings like
SyntaxWarning: invalid escape sequence '\S'
2025-07-13 23:42:50 +01:00
Jeroen Ketema
d82d5c23bf Merge pull request #20026 from jketema/concept-fix
C++: Fix C++20 concept related class extensions
2025-07-13 10:20:10 +02:00
Owen Mansel-Chan
391e9f7471 Merge pull request #20000 from owen-mc/go/request-forgery
Go: Add `Head` and `Client.Head` from `net/http` as request forgery sinks
2025-07-12 00:30:23 +01:00
Owen Mansel-Chan
03e8865933 Merge pull request #20025 from owen-mc/java/unsafe-deserialization
Java: add extra sink for `java/unsafe-deserialization`
2025-07-11 23:59:22 +01:00
Geoffrey White
05e1cd437d Rust: Fix garbled merge. 2025-07-11 17:50:24 +01:00
Geoffrey White
e20ae48699 Merge branch 'main' into models3b 2025-07-11 17:37:52 +01:00
Adnan Khan
c95b5ce598 Merge branch 'main' into patch-1 2025-07-11 09:12:39 -07:00
AdnaneKhan
6ac0f0e031 Fix change note filename. 2025-07-11 12:11:58 -04:00
Geoffrey White
68a37f99e3 Rust: Add something similar as a type inference test case. 2025-07-11 17:08:05 +01:00
Arthur Baars
14a362d1bc Merge pull request #20029 from github/aibaars/more-pattern-tests
Rust: add more type inference tests for patterns and a simple one for a closure call
2025-07-11 17:35:37 +02:00
Geoffrey White
33ea822f40 Rust: Workaround for type inference issue in the test. 2025-07-11 16:09:43 +01:00
Taus
30f705822d JavaScript: Add test where outDir resolves to an unwanted path 2025-07-11 14:58:03 +00:00
Taus
344535b559 Merge pull request #19672 from github/tausbn/python-support-type-annotations-in-call-graph
Python: Support type annotations in call graph
2025-07-11 16:44:10 +02:00
Tom Hvitved
88b4f971b5 Merge pull request #20027 from hvitved/rust/remove-resolves-as-item
Rust: Remove `Resolvable.resolvesAsItem`
2025-07-11 16:39:12 +02:00
Mathias Vorreiter Pedersen
1da42cb590 Merge pull request #20023 from MathiasVP/dataflow-for-functors
C++: Better dataflow for function objects
2025-07-11 15:14:27 +01:00
Arthur Baars
519905ee9e Rust: type inference: add test for closure argument 2025-07-11 15:59:43 +02:00
Arthur Baars
32e7a9d445 Rust: type inference: more pattern matching tests
Thanks to co-pilot for generating the examples
2025-07-11 15:55:45 +02:00
Taus
2f822cb0cd JavaScript: Add change note 2025-07-11 13:32:35 +00:00
Taus
43accc50cd JavaScript: Ignore outDirs that would exclude everything
In #19680 we added support for automatically ignoring files in the
`outDir` directory as specified in the TSconfig compiler options (as
these files were likely duplicates of `.ts` file we were already
scanning).

However, in some cases people put `outDir: "."` or even `outDir: ".."`
in their configuration, which had the side effect of excluding _all_
files, leading to a failed extraction.

With the changes in this PR, we now ignore any `outDir`s that are not
properly contained within the source root of the code being scanned.
This should prevent the files from being extracted, while still allowing
us to not double-scan files in, say, a `.github` directory, as seen in
some Actions workflows.
2025-07-11 13:28:59 +00:00
Mathias Vorreiter Pedersen
053a749e14 C++: Add change note. 2025-07-11 13:43:01 +01:00
Tom Hvitved
655b3de6bb Rust: Remove Resolvable.resolvesAsItem
Removes one more use of extractor-based resolution.
2025-07-11 14:41:41 +02:00
Mathias Vorreiter Pedersen
649c8831ec Merge pull request #20014 from jketema/wchar
C++: Do not alert on unreachable code in `cpp/incorrect-string-type-conversion`
2025-07-11 13:39:37 +01:00
Tom Hvitved
0a18db8960 Merge pull request #20020 from hvitved/rust/type-inference-pattern-matching
Rust: Type inference for pattern matching
2025-07-11 14:05:10 +02:00
Taus
c6c6a857df Python: Add tests
Also fixes an issue with the return type annotations that caused these
to not work properly.

Currently, annotated assignments don't work properly, due to the fact
that our flow relation doesn't consider flow going to the "type" part of
an annotated assignment. This means that in `x : Foo`, we do correctly
note that `x` is annotated with `Foo`, but we have no idea what `Foo`
is, since it has no incoming flow.

To fix this we should probably just extend the flow relation, but this
may need to be done with some care, so I have left it as future work.
2025-07-11 12:03:14 +00:00
Taus
2c45550a9f Python: Add change note
Co-authored-by: Napalys Klicius <napalys@github.com>
2025-07-11 12:03:14 +00:00
Taus
d1cf7f0624 Python: Support type annotations in call graph
Adds support for tracking instances via type annotations. Also adds a
convenience method to the newly added `Annotation` class,
`getAnnotatedExpression`, that returns the expression that is annotated
with the given type. For return annotations this is any value returned
from the annotated function in question.

Co-authored-by: Napalys Klicius <napalys@github.com>
2025-07-11 12:03:14 +00:00
Jeroen Ketema
232377a583 C++: Fix C++20 concept related class extensions 2025-07-11 13:38:06 +02:00
Tom Hvitved
edf6c7fbd6 Rust: Handle (Enum::)Variant::<TypeArg> type mentions 2025-07-11 12:44:47 +02:00
Tom Hvitved
a96d3d7be8 Rust: Add more type inference tests 2025-07-11 12:42:54 +02:00
Owen Mansel-Chan
7764fbb664 Change note 2025-07-11 11:05:48 +01:00
Owen Mansel-Chan
8e4bd1a102 Add sink for ObjectInput.readObject to make test pass 2025-07-11 11:05:38 +01:00
Owen Mansel-Chan
34fae324a0 Add test for ObjectInput.readObject 2025-07-11 11:03:47 +01:00
Mathias Vorreiter Pedersen
4f538a2b1f C++: Accept taint test changes. 2025-07-11 09:46:22 +01:00
Mathias Vorreiter Pedersen
6d0c8c6d77 C++: Work around an extractor bug. 2025-07-11 09:46:20 +01:00
Mathias Vorreiter Pedersen
df241ad4f6 C++: Fix lambda creation for objects with no constructor. 2025-07-11 09:46:09 +01:00
Tom Hvitved
ac13f408e4 Add change note 2025-07-11 10:42:50 +02:00
Tom Hvitved
4ab2977358 Rust: Type inference for pattern matching 2025-07-11 10:37:40 +02:00
Mathias Vorreiter Pedersen
b53c3547d0 C++: Add lambda dispatch for functors. 2025-07-11 09:36:45 +01:00
Mathias Vorreiter Pedersen
663c3e7b6d C++: Sync identical files. 2025-07-11 09:36:44 +01:00
Mathias Vorreiter Pedersen
11cba94032 C++: Add a missing predicate on 'UninitializedInstruction' that we will use later. 2025-07-11 09:36:42 +01:00
Mathias Vorreiter Pedersen
6736dd4e8f C++: Add some tests with missing flow through function objects. 2025-07-11 09:36:38 +01:00
Tom Hvitved
53ee565fdb Rust: Add more type inference tests 2025-07-11 10:22:24 +02:00
Jonas Jensen
76544f2966 Merge pull request #19943 from asgerf/approximate-related-location
Support approximate related locations
2025-07-11 10:16:24 +02:00
Tom Hvitved
742139927c Merge pull request #19658 from hvitved/rust/type-inference-library-param-fix
Rust: Fix type inference for library parameters
2025-07-11 08:34:19 +02:00
Adnan Khan
07598e8b62 Add test results. 2025-07-11 05:59:13 +00:00
Owen Mansel-Chan
006d77ffdd Refactor QL to make type check more concise 2025-07-11 06:13:01 +01:00
Tom Hvitved
1d7d45e16b Rust: Update expected test output 2025-07-10 19:40:39 +02:00
Tom Hvitved
8cd357a8a0 Rust: Fix type inference for library parameters 2025-07-10 19:40:37 +02:00
Tom Hvitved
1e9520c737 Merge pull request #19995 from hvitved/rust/disambiguate-assoc-function-calls
Rust: Disambiguate associated function calls
2025-07-10 19:38:06 +02:00
Geoffrey White
6de5a618f3 Rust: Accept consistency changes as well. 2025-07-10 18:03:12 +01:00
Jeroen Ketema
6d8e2f8231 Merge pull request #20017 from jketema/final
C++: Add dataflow predicate for checking if a node is the final value of a parameter
2025-07-10 18:47:09 +02:00
Geoffrey White
01c75e38f7 Rust: The rusqlite row.get() calls are missing a canonical path. 2025-07-10 17:31:37 +01:00
AdnaneKhan
1b794e056a Add extra test suggested by @Napalys 2025-07-10 12:24:36 -04:00
Adnan Khan
7be938c6c3 Handle multiple whitespaces in runner temp regex.
Co-authored-by: Napalys Klicius <napalys@github.com>
2025-07-10 12:22:14 -04:00
Geoffrey White
75078346c0 Rust: Accept .expected changes (mostly renumberings). 2025-07-10 17:05:12 +01:00
Owen Mansel-Chan
c39e5a7d97 Update qhelp: SnakeYaml is safe from version 2.0 2025-07-10 16:54:00 +01:00
Nick Rolfe
3a0def7848 Merge pull request #19989 from github/nickrolfe/ruby-annotations
Ruby: add overlay annotations to AST/CFG/SSA layers
2025-07-10 11:53:21 -04:00
Mathias Vorreiter Pedersen
fefb35bede Merge pull request #20016 from MathiasVP/add-more-thread-create-models
C++: Add more thread creation models
2025-07-10 16:44:04 +01:00
Jeroen Ketema
96c379a076 C++: Fix formatting and typo 2025-07-10 15:56:11 +02:00
Geoffrey White
7ba18fa5d0 Merge branch 'main' into models3b 2025-07-10 14:53:09 +01:00
Jeroen Ketema
214969feaf C++: Add change note 2025-07-10 15:52:27 +02:00
Geoffrey White
439cf7a659 Merge pull request #19942 from geoffw0/models1
Rust: Update legacy MaD models 2
2025-07-10 14:50:48 +01:00
Jeroen Ketema
b32a8c2489 C++: Add dataflow predicate for checking if a node is the final value of a parameter 2025-07-10 15:47:23 +02:00
Jeroen Ketema
990b7f0b70 C++: Add change note 2025-07-10 15:13:15 +02:00
Geoffrey White
0c075abe3f Rust: Fix merge (I picked the wrong version). 2025-07-10 13:59:10 +01:00
Geoffrey White
2cd4d984cc Merge pull request #20002 from geoffw0/moresensitive1
Rust: Add more test cases for sensitive data
2025-07-10 13:54:20 +01:00
Geoffrey White
117e330d53 Merge branch 'main' into models1 2025-07-10 13:52:48 +01:00
Geoffrey White
3debd1ada9 Merge pull request #19948 from geoffw0/models5
Rust: Update legacy MaD models 4
2025-07-10 13:50:54 +01:00
Tom Hvitved
70476c0e14 Add change note 2025-07-10 14:50:00 +02:00
Mathias Vorreiter Pedersen
7ddc909d4e C++: Accept test changes after review. 2025-07-10 13:29:19 +01:00
Tamás Vajk
1351f57d2b Merge pull request #19998 from tamasvajk/quality/label-in-switch
Java: Add query to detect non-case labels in switch statements
2025-07-10 14:13:38 +02:00
Mathias Vorreiter Pedersen
dda4a97080 Update cpp/ql/test/library-tests/dataflow/external-models/test.cpp
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2025-07-10 13:00:43 +01:00
Tom Hvitved
054bbc2ff7 Merge pull request #20015 from hvitved/rust/fix-bad-join
Rust: Fix bad join
2025-07-10 13:59:07 +02:00
Mathias Vorreiter Pedersen
b547dc4621 C++: Add change note. 2025-07-10 12:52:55 +01:00
Tom Hvitved
c7d20eb98a Rust: Update expected test output 2025-07-10 13:52:19 +02:00
Tom Hvitved
ebde0bdc47 Rust: Disambiguate calls to associated functions 2025-07-10 13:52:17 +02:00
Tom Hvitved
95c2b9f8f7 Rust: Add more type inference tests 2025-07-10 13:52:09 +02:00
Mathias Vorreiter Pedersen
89cf215ebb C++: Add models for 'std::thread' and accept test changes. 2025-07-10 12:45:20 +01:00
Mathias Vorreiter Pedersen
2062a774fc C++: Add 'std::thread' test with missing flow. 2025-07-10 12:44:02 +01:00
Mathias Vorreiter Pedersen
d198a964e0 C++: Add a model for 'pthread_create' and accept test changes. 2025-07-10 12:20:24 +01:00
Mathias Vorreiter Pedersen
675a072639 C++: Add 'pthread_create' test with missing flow. 2025-07-10 12:16:23 +01:00
Owen Mansel-Chan
e362e536c0 Merge pull request #20009 from github/dependabot/go_modules/go/extractor/extractor-dependencies-0e1361fb85
Bump golang.org/x/mod from 0.25.0 to 0.26.0 in /go/extractor in the extractor-dependencies group
2025-07-10 11:51:03 +01:00
Tom Hvitved
d4de56c157 Rust: Fix bad join
Before
```
Evaluated relational algebra for predicate TypeInference::getRangeType/1#b4219ae9@c15c3f0b with tuple counts:
               1   ~0%    {1} r1 = CONSTANT(unique string)[".."]
             692   ~0%    {1}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getOperatorName/0#dispred#7c90645c_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1

             453   ~0%    {1} r2 = JOIN r1 WITH `RangeExpr::Generated::RangeExpr.getStart/0#dispred#914c8207` ON FIRST 1 OUTPUT Lhs.0

             266   ~1%    {1} r3 = JOIN r2 WITH `RangeExpr::Generated::RangeExpr.getEnd/0#dispred#6c692cfa` ON FIRST 1 OUTPUT Lhs.0
        10684422   ~0%    {3}    | JOIN WITH cached_Synth::Synth::TStruct#c298e97c CARTESIAN PRODUCT OUTPUT Rhs.1, _, Lhs.0
        10684422   ~0%    {3}    | REWRITE WITH Out.1 := "core::ops::range::Range"
             266   ~0%    {2}    | JOIN WITH `Addressable::Addressable.getCanonicalPath/0#dispred#6044348f#bb` ON FIRST 2 OUTPUT Lhs.2, Lhs.0

             363   ~3%    {1} r4 = JOIN r1 WITH `RangeExpr::Generated::RangeExpr.getEnd/0#dispred#6c692cfa` ON FIRST 1 OUTPUT Lhs.0
              97   ~2%    {1}    | AND NOT `RangeExpr::Generated::RangeExpr.getStart/0#dispred#914c8207_0#antijoin_rhs`(FIRST 1)
         3896199   ~0%    {3}    | JOIN WITH cached_Synth::Synth::TStruct#c298e97c CARTESIAN PRODUCT OUTPUT Rhs.1, _, Lhs.0
         3896199   ~0%    {3}    | REWRITE WITH Out.1 := "core::ops::range::RangeTo"
              97   ~1%    {2}    | JOIN WITH `Addressable::Addressable.getCanonicalPath/0#dispred#6044348f#bb` ON FIRST 2 OUTPUT Lhs.2, Lhs.0

             187   ~0%    {1} r5 = r2 AND NOT `RangeExpr::Generated::RangeExpr.getEnd/0#dispred#6c692cfa_0#antijoin_rhs`(FIRST 1)
         7511229   ~2%    {3}    | JOIN WITH cached_Synth::Synth::TStruct#c298e97c CARTESIAN PRODUCT OUTPUT Rhs.1, _, Lhs.0
         7511229   ~0%    {3}    | REWRITE WITH Out.1 := "core::ops::range::RangeFrom"
             187   ~1%    {2}    | JOIN WITH `Addressable::Addressable.getCanonicalPath/0#dispred#6044348f#bb` ON FIRST 2 OUTPUT Lhs.2, Lhs.0

               1   ~0%    {1} r6 = CONSTANT(unique string)["..="]
             138   ~0%    {1}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getOperatorName/0#dispred#7c90645c_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1

             131   ~0%    {1} r7 = JOIN r6 WITH `RangeExpr::Generated::RangeExpr.getStart/0#dispred#914c8207` ON FIRST 1 OUTPUT Lhs.0
             131   ~0%    {1}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getEnd/0#dispred#6c692cfa` ON FIRST 1 OUTPUT Lhs.0
         5261877   ~0%    {3}    | JOIN WITH cached_Synth::Synth::TStruct#c298e97c CARTESIAN PRODUCT OUTPUT Rhs.1, _, Lhs.0
         5261877   ~0%    {3}    | REWRITE WITH Out.1 := "core::ops::range::RangeInclusive"
             131   ~3%    {2}    | JOIN WITH `Addressable::Addressable.getCanonicalPath/0#dispred#6044348f#bb` ON FIRST 2 OUTPUT Lhs.2, Lhs.0

             138   ~0%    {1} r8 = JOIN r6 WITH `RangeExpr::Generated::RangeExpr.getEnd/0#dispred#6c692cfa` ON FIRST 1 OUTPUT Lhs.0
               7   ~0%    {1}    | AND NOT `RangeExpr::Generated::RangeExpr.getStart/0#dispred#914c8207_0#antijoin_rhs`(FIRST 1)
          281169   ~0%    {3}    | JOIN WITH cached_Synth::Synth::TStruct#c298e97c CARTESIAN PRODUCT OUTPUT Rhs.1, _, Lhs.0
          281169   ~2%    {3}    | REWRITE WITH Out.1 := "core::ops::range::RangeToInclusive"
               7   ~0%    {2}    | JOIN WITH `Addressable::Addressable.getCanonicalPath/0#dispred#6044348f#bb` ON FIRST 2 OUTPUT Lhs.2, Lhs.0

             688   ~0%    {2} r9 = r3 UNION r4 UNION r5 UNION r7 UNION r8
                          return r9
```

After
```
Evaluated relational algebra for predicate TypeInference::getRangeType/1#b4219ae9@7d06d41t with tuple counts:
          1   ~0%    {2} r1 = SCAN Stdlib::RangeToStruct#236b6b84 OUTPUT _, In.0
          1   ~0%    {2}    | REWRITE WITH Out.0 := ".."
        692   ~0%    {2}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getOperatorName/0#dispred#7c90645c_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1
        363   ~0%    {2}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getEnd/0#dispred#6c692cfa` ON FIRST 1 OUTPUT Lhs.0, Lhs.1
         97   ~0%    {2}    | AND NOT `RangeExpr::Generated::RangeExpr.getStart/0#dispred#914c8207_0#antijoin_rhs`(FIRST 1)

          1   ~0%    {2} r2 = SCAN Stdlib::RangeFromStruct#8edcefe7 OUTPUT _, In.0
          1   ~0%    {2}    | REWRITE WITH Out.0 := ".."
        692   ~0%    {2}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getOperatorName/0#dispred#7c90645c_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1
        453   ~0%    {2}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getStart/0#dispred#914c8207` ON FIRST 1 OUTPUT Lhs.0, Lhs.1
        187   ~0%    {2}    | AND NOT `RangeExpr::Generated::RangeExpr.getEnd/0#dispred#6c692cfa_0#antijoin_rhs`(FIRST 1)

          1   ~0%    {2} r3 = SCAN Stdlib::RangeToInclusiveStruct#fe43a433 OUTPUT _, In.0
          1   ~0%    {2}    | REWRITE WITH Out.0 := "..="
        138   ~0%    {2}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getOperatorName/0#dispred#7c90645c_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1
        138   ~0%    {2}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getEnd/0#dispred#6c692cfa` ON FIRST 1 OUTPUT Lhs.0, Lhs.1
          7   ~0%    {2}    | AND NOT `RangeExpr::Generated::RangeExpr.getStart/0#dispred#914c8207_0#antijoin_rhs`(FIRST 1)

          1   ~0%    {2} r4 = SCAN Stdlib::RangeStruct#0fabc810 OUTPUT _, In.0
          1   ~0%    {2}    | REWRITE WITH Out.0 := ".."
        692   ~3%    {2}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getOperatorName/0#dispred#7c90645c_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1
        453   ~4%    {2}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getStart/0#dispred#914c8207` ON FIRST 1 OUTPUT Lhs.0, Lhs.1
        266   ~2%    {2}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getEnd/0#dispred#6c692cfa` ON FIRST 1 OUTPUT Lhs.0, Lhs.1

          1   ~0%    {2} r5 = SCAN Stdlib::RangeInclusiveStruct#a869750a OUTPUT _, In.0
          1   ~0%    {2}    | REWRITE WITH Out.0 := "..="
        138   ~0%    {2}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getOperatorName/0#dispred#7c90645c_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1
        131   ~0%    {2}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getStart/0#dispred#914c8207` ON FIRST 1 OUTPUT Lhs.0, Lhs.1
        131   ~0%    {2}    | JOIN WITH `RangeExpr::Generated::RangeExpr.getEnd/0#dispred#6c692cfa` ON FIRST 1 OUTPUT Lhs.0, Lhs.1

        688   ~7%    {2} r6 = r1 UNION r2 UNION r3 UNION r4 UNION r5
                     return r6
```
2025-07-10 12:34:08 +02:00
Kasper Svendsen
0739c03d03 Overlay: Add discarding of base XML locatables for Java 2025-07-10 12:31:16 +02:00
Kasper Svendsen
d7094a96b5 Overlay: Add discarding of all Java base properties 2025-07-10 12:31:15 +02:00
Arthur Baars
b573246639 Merge pull request #20003 from github/aibaars/query-result
Rust: add test cases for basic unwrapping and pattern matching
2025-07-10 12:30:59 +02:00
Kasper Svendsen
767d55bb18 Merge pull request #20013 from kaspersv/kaspersv/ql4ql-discard-entity-preds-alive
QL4QL: Discard predicates are always alive
2025-07-10 12:30:44 +02:00
Kasper Svendsen
c7a3b6543e Address copilot comment 2025-07-10 12:01:29 +02:00
Jeroen Ketema
399967b507 C++: Do not alert on unreachable code in cpp/incorrect-string-type-conversion 2025-07-10 11:49:12 +02:00
Jeroen Ketema
2907861075 C++: Add cpp/incorrect-string-type-conversion test with unreachable code 2025-07-10 11:48:53 +02:00
Jeroen Ketema
acc06fab20 C++: Convert cpp/incorrect-string-type-conversion test to inline expectations 2025-07-10 11:48:18 +02:00
Geoffrey White
4dea5eef70 Rust: Fix futures_io models. 2025-07-10 10:41:09 +01:00
Nick Rolfe
ab9ba02ea1 Ruby: enable overlay compilation 2025-07-10 10:38:06 +01:00
Arthur Baars
cc5e6b2195 Rust: add test cases for basic unwrapping and pattern matching 2025-07-10 11:15:07 +02:00
Jeroen Ketema
18760b4025 Merge pull request #10923 from dscho/patch-1
Download GitHub database: fix `gh` invocation
2025-07-10 11:11:59 +02:00
Kasper Svendsen
1723c6ed09 QL4QL: Add discard predicate to dead code test 2025-07-10 11:09:43 +02:00
Kasper Svendsen
9f260cf72f QL4QL: Discard predicates are always alive 2025-07-10 11:09:42 +02:00
Kasper Svendsen
9de3617032 QL4QL: Add overlay[discard_entity] annotation 2025-07-10 11:09:42 +02:00
Arthur Baars
7c5cdd9a9b Merge pull request #20001 from github/aibaars/trait-impl-int
Rust: fix missing canonical paths for trait impls on builtin numeric types
2025-07-10 10:53:01 +02:00
Jeroen Ketema
51f639111b Merge pull request #20010 from jketema/change-typo
C++: Fix some typos in recent change notes
2025-07-10 10:48:40 +02:00
Geoffrey White
8177b0938d Merge branch 'main' into models5 2025-07-10 09:41:48 +01:00
Jeroen Ketema
928b7475b2 C++: Fix some typos in recent change notes 2025-07-10 10:22:41 +02:00
Geoffrey White
ae3253b9c3 Merge pull request #20004 from geoffw0/tt
Rust: Add type inference test cases for tuples.
2025-07-10 09:12:47 +01:00
Johannes Schindelin
3bff6c4a4a Download GitHub database: fix gh invocation on Windows
When running `gh api /repos/...` in the Git Bash on Windows, it leads to
a 404. The reason is the automatic path conversion from "Unix-y" paths
on the command-line to proper Windows paths, as described in detail
https://www.msys2.org/docs/filesystem-paths/. Git Bash simply has no
chance to understnad that `/repos/...` is not referring to an absolute
path on the local filesystem.

Let's just skip the leading slash. This is as valid an invocation, and
sidesteps that path conversion on Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2025-07-10 10:01:18 +02:00
Tamas Vajk
5edb60ea04 Improve query documentation 2025-07-10 09:43:15 +02:00
Hugo
c3c8d5db13 Create 2025-06-10-getasupertype.md
Create 2025-06-10-getasupertype.md
2025-07-10 05:48:52 +02:00
dependabot[bot]
e57b272cfa Bump golang.org/x/mod
Bumps the extractor-dependencies group in /go/extractor with 1 update: [golang.org/x/mod](https://github.com/golang/mod).


Updates `golang.org/x/mod` from 0.25.0 to 0.26.0
- [Commits](https://github.com/golang/mod/compare/v0.25.0...v0.26.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-version: 0.26.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: extractor-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-10 03:41:42 +00:00
Adnan Khan
e40e4c3856 Remove unneeded test file. 2025-07-09 23:06:18 -04:00
Hugo
fb693837e4 feat: add getASupertype() predicate in ValueOrRefType.
Add the getASupertype() predicate in ValueOrRefType.
2025-07-10 02:19:17 +02:00
Geoffrey White
36720ca4dd Rust: Update .expected file after autoformat. 2025-07-09 21:52:23 +01:00
Arthur Baars
d20bc98363 Rust: fix missing canonical paths 2025-07-09 21:42:53 +02:00
Geoffrey White
6c9c8904d7 Rust: Autoformat. 2025-07-09 18:43:33 +01:00
Geoffrey White
dfbdd2bd02 Rust: Add type inference test cases for tuples. 2025-07-09 16:54:24 +01:00
Geoffrey White
47a4ba33a4 Rust: Fix typo in models (also fixed in another open PR). 2025-07-09 16:00:35 +01:00
Geoffrey White
a034e29040 Rust: Simplify the test a little. 2025-07-09 15:52:54 +01:00
Geoffrey White
097ac69207 Rust: Current sources test regressions. 2025-07-09 15:52:19 +01:00
Geoffrey White
8d0c14ca4e Merge branch 'main' into models3b 2025-07-09 15:25:16 +01:00
Geoffrey White
4281fe74bd Rust: We don't really need the split into two test cases any more. 2025-07-09 15:22:04 +01:00
Geoffrey White
4397863586 Rust: Update after merge with main. 2025-07-09 15:17:31 +01:00
Geoffrey White
597f678978 Merge branch 'main' into models1 2025-07-09 14:48:32 +01:00
Nick Rolfe
c415795595 Ruby: add changenote for overlay[local] annotations 2025-07-09 13:32:49 +01:00
Jonas Jensen
3ffda2f341 Shared: Overhaul the AlertFiltering QLDoc
The documentation is now up-to-date with the new and more relaxed rules
that allow overapproximating the results. I have also attempted to make
a clearer distinction between the requirements of the specification and
the behaviour of the implementation.
2025-07-09 14:32:18 +02:00
Geoffrey White
3bb3fccfdb Rust: Accept consistency check changes. 2025-07-09 12:02:30 +01:00
Nick Rolfe
e1f2433dbf Ruby: make resolveConstant overlay[global] 2025-07-09 11:59:25 +01:00
Geoffrey White
22aa7f378a Rust: Expand the test cases around IDs as sensitive data. 2025-07-09 11:33:47 +01:00
Geoffrey White
1124355cdb Rust: Add a test case for 'from_trusted_iterator' as sensitive data FP. 2025-07-09 11:26:59 +01:00
Jonas Jensen
5a1246a586 Merge remote-tracking branch 'upstream/main' into approximate-related-location 2025-07-09 10:10:20 +02:00
Jonas Jensen
0d7a842e2f Shared: improve documentation in AlertFiltering 2025-07-09 09:43:49 +02:00
Jonas Jensen
f1e9f0e323 Shared: improve join order in filterByLocation
It's better to join with the range expression first since that will only
multiply tuple counts by the number of lines in an average source/sink.
Joining with `restrictAlertsToStartLine` first would multiply tuple
counts by the number of sources/sinks in a given file.
2025-07-09 09:24:26 +02:00
Paolo Tranquilli
5722084dd5 Merge pull request #19999 from github/redsun82/rust-sha256s
Rust: set SHA256s in `MODULE.bazel`
2025-07-09 09:20:54 +02:00
Adnan Khan
db954d6d9f Merge branch 'main' into patch-1 2025-07-08 23:31:35 -07:00
Arthur Baars
5b7485d11d Rust: add testcase for impl trait on i32 2025-07-08 21:36:37 +02:00
Tom Hvitved
156f867c96 Merge pull request #19996 from hvitved/rust/type-inference-str-literal
Rust: Adjust the inferred type of string literals
2025-07-08 20:29:43 +02:00
Jaroslav Lobačevski
9393181c4e Add tests and path normalization fix to handle $ expansion 2025-07-08 16:18:12 +00:00
Owen Mansel-Chan
a5333ae1a1 Add change note 2025-07-08 16:51:22 +01:00
Paolo Tranquilli
98195db500 Rust: set SHA256s in MODULE.bazel 2025-07-08 17:49:30 +02:00
AdnaneKhan
5d6a5d5cbb Add change notes and test workflow file. 2025-07-08 10:35:39 -04:00
Adnan Khan
f4f919635a Correctly specify regex.
Co-authored-by: Jaroslav Lobačevski <jarlob@github.com>
2025-07-08 10:17:29 -04:00
Geoffrey White
b1d5b8175c Rust: Add the original test back as well. 2025-07-08 15:10:55 +01:00
Geoffrey White
d19259e6bb Update rust/ql/test/library-tests/frameworks/postgres/main.rs
Co-authored-by: Arthur Baars <aibaars@github.com>
2025-07-08 15:03:44 +01:00
Geoffrey White
7211f4ace3 Update rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml
Co-authored-by: Arthur Baars <aibaars@github.com>
2025-07-08 15:01:43 +01:00
Tom Hvitved
22b833fbda Rust: Fix bad join 2025-07-08 16:00:36 +02:00
Owen Mansel-Chan
990043ce86 Add net/http.Head and net/http.Client.Head as client requests
They were previously deliberately excluded.
2025-07-08 14:31:48 +01:00
Owen Mansel-Chan
71703aa497 Improve formatting of some QL 2025-07-08 14:29:11 +01:00
Tamás Vajk
4f1ca21ef9 Merge pull request #19875 from tamasvajk/quality/spec_chars
Java: Add query to detect special characters in string literals
2025-07-08 14:56:35 +02:00
Tamas Vajk
5f7d746266 Java: Add query to detect non-case labels in switch statements 2025-07-08 14:53:39 +02:00
Owen Mansel-Chan
d437a096f1 Test more client request URL sinks 2025-07-08 13:20:04 +01:00
Nick Rolfe
b51940d1e2 Ruby: add overlay[local] annotations to AST/CFG/SSA layers 2025-07-08 13:09:27 +01:00
Tamas Vajk
ccbf7055f1 Adjust query precision 2025-07-08 13:31:08 +02:00
Tamas Vajk
d16570b05e Revert "Adjust query tags"
This reverts commit 92685e6c2de69898d556706b04e6c562e54b26b8.
2025-07-08 13:28:26 +02:00
Tamas Vajk
c4def103f7 Improve query documentation 2025-07-08 13:28:26 +02:00
Tamas Vajk
15de398806 Adjust query tags 2025-07-08 13:28:25 +02:00
Tamas Vajk
a0c9c98373 Adjust references in query doc 2025-07-08 13:28:25 +02:00
Tamas Vajk
fd8b37cc28 Exclude Kotlin files 2025-07-08 13:28:24 +02:00
Tamas Vajk
09a2aeead6 Java: Add query to detect special characters in string literals 2025-07-08 13:28:18 +02:00
Tamás Vajk
f940cb2bdd Merge pull request #19950 from tamasvajk/quality/useless-record-member
Java: Add 'Useless serialization member in record class' query
2025-07-08 13:26:11 +02:00
Tom Hvitved
2a207f9f6f Rust: Update inline expectations 2025-07-08 13:03:16 +02:00
Tom Hvitved
73f854f073 Rust: Adjust the inferred type of string literals 2025-07-08 13:03:12 +02:00
Tom Hvitved
411aa6d2e5 Merge pull request #19971 from hvitved/rust/type-inference-for-range
Rust: Improve type inference for `for` loops and range expressions
2025-07-08 12:57:21 +02:00
Geoffrey White
3dabd51cf7 Rust: Fix a summaryModelDeprecated that was causing problems. 2025-07-08 11:24:57 +01:00
Tom Hvitved
1518cade7b Address review comments 2025-07-08 11:29:24 +02:00
Tamas Vajk
813ce7d3f8 Rename query 2025-07-08 11:28:12 +02:00
Tamas Vajk
f2805ba80c Improve query help 2025-07-08 11:28:11 +02:00
Tamas Vajk
82fe647a40 Improve alert message 2025-07-08 11:28:11 +02:00
Tamas Vajk
528389af38 Adjust expected file for query suite integration test 2025-07-08 11:28:10 +02:00
Tamas Vajk
a2d4f58af7 Use inline test expectations 2025-07-08 11:28:10 +02:00
Tamas Vajk
2cd0c64e41 Improve query quality 2025-07-08 11:28:09 +02:00
Tamas Vajk
e0cb1792bd Java: Add 'Useless serialization member in record class' query 2025-07-08 11:28:09 +02:00
Tom Hvitved
6876838dd1 Rust: Add change note 2025-07-08 11:20:45 +02:00
Tom Hvitved
7701a31f4a Rust: Improve type inference for for loops and range expressions 2025-07-08 11:20:42 +02:00
Tom Hvitved
52abf3ba02 Merge pull request #19997 from hvitved/java/use-mad-in-log-injection-test
Java: Use MaD in log injection test
2025-07-08 11:02:51 +02:00
Geoffrey White
f57d691424 Rust: Fix typo in model. 2025-07-08 09:51:20 +01:00
Tom Hvitved
6fdec47e83 Java: Use MaD in log injection test 2025-07-08 10:25:58 +02:00
Geoffrey White
c7de873a22 Rust: Update the libc models. 2025-07-08 08:44:44 +01:00
Geoffrey White
a1e9a4eddf Rust: Accept test .expected changes. 2025-07-08 08:44:24 +01:00
Geoffrey White
2195f0bb78 Merge branch 'main' into models5 2025-07-08 08:41:43 +01:00
Ian Lynagh
e5b4a15e35 Merge pull request #19994 from github/post-release-prep/codeql-cli-2.22.2
Post-release preparation for codeql-cli-2.22.2
2025-07-07 19:44:16 +01:00
Tom Hvitved
33e63109bb Merge pull request #19993 from hvitved/rust/type-inference-function-call-expectations
Rust: Add type inference inline expectations for all function calls
2025-07-07 20:40:57 +02:00
github-actions[bot]
24a0ac1223 Post-release preparation for codeql-cli-2.22.2 2025-07-07 18:15:04 +00:00
Arthur Baars
aef357c757 Merge pull request #19988 from github/aibaars/extern-blocks
Rust: path resolution: handle items in `extern` blocks
2025-07-07 19:53:36 +02:00
Arthur Baars
8114071804 Merge branch 'main' into models1 2025-07-07 19:47:53 +02:00
Ian Lynagh
bb0173c9af Merge pull request #19992 from github/release-prep/2.22.2
Release preparation for version 2.22.2
2025-07-07 17:54:28 +01:00
Arthur Baars
7721d14314 Rust: use getADescendant instead of getAnItem
This should handle all cases where items contained in intermediate nodes, such as MacroCall,
ExternBlock and MacroItem nodes.
2025-07-07 18:04:00 +02:00
Arthur Baars
da2f0f6069 Rust: remove MacroCallItemNode
Macro calls are not really items, so they can just be skipped
2025-07-07 18:03:02 +02:00
Arthur Baars
7556d7b57b Rust: add test with extern block 2025-07-07 18:02:58 +02:00
Tom Hvitved
fad5e0daa8 Rust: Add type inference inline expectations for all function calls 2025-07-07 17:20:15 +02:00
Geoffrey White
a25330e6ed Rust: Update rustcrypto models. 2025-07-07 15:10:59 +01:00
github-actions[bot]
f12daefabe Release preparation for version 2.22.2 2025-07-07 14:00:26 +00:00
Tamás Vajk
8d16d0225c Merge pull request #19991 from tamasvajk/quality/improve-query-docs
Improve query docs for `java/java-util-concurrent-scheduledthreadpoolexecutor`
2025-07-07 15:02:56 +02:00
Geoffrey White
a486549956 Update rust/ql/lib/codeql/rust/frameworks/tokio/io.model.yml
Co-authored-by: Arthur Baars <aibaars@github.com>
2025-07-07 14:01:00 +01:00
Tamas Vajk
6013c347df Improve query docs for java/java-util-concurrent-scheduledthreadpoolexecutor 2025-07-07 14:22:40 +02:00
Mathias Vorreiter Pedersen
7bb3758093 Merge pull request #19976 from jketema/incr-2
C++: Output `CopyValue` in the IR when there is a non-transparent conversion
2025-07-07 13:08:50 +01:00
Jeroen Ketema
a004d9b2a2 Merge pull request #19990 from igfoo/igfoo/rename
C++: Rename a changenote file
2025-07-07 13:59:15 +02:00
Ian Lynagh
fd733676cb C++: Rename a changenote file 2025-07-07 12:53:42 +01:00
Nick Rolfe
eb30233d44 Merge pull request #19963 from github/nickrolfe/rb-discard-locations
Ruby/QL: add discard predicates for locations
2025-07-07 06:41:28 -04:00
Tom Hvitved
8c90250dfc Merge pull request #19577 from hvitved/rust/remove-library-source-dedup-logic
Rust: Remove source vs library deduplication logic
2025-07-07 11:25:33 +02:00
Tom Hvitved
6a9ed88d6e Merge pull request #19975 from hvitved/rust/ssa-phi-in-capture
Rust: Fix SSA inconsistencies
2025-07-07 09:21:57 +02:00
Jeroen Ketema
d6d7c6d55f Revert "C++: Factor out transparent conversions in their own predicate"
This reverts commit b185cc8b95.
2025-07-04 23:22:46 +02:00
Jeroen Ketema
463ae4b1eb C++: Address review comments 2025-07-04 23:13:37 +02:00
Owen Mansel-Chan
0788a90d88 Convert RequestForgery test to inline expectations 2025-07-04 16:56:05 +01:00
Owen Mansel-Chan
d10b9e665c Fix linter warnings in Request Forgery tests 2025-07-04 16:55:09 +01:00
Nick Rolfe
7c5b186c71 Ruby/QL: add discard predicates for locations 2025-07-04 16:15:38 +01:00
Nick Rolfe
f714e5c5ba Merge pull request #19896 from github/nickrolfe/overlay-deleted-files
Java/Ruby/Rust/QL: add `overlayChangedFiles` relation to dbscheme
2025-07-04 11:10:20 -04:00
Arthur Baars
84e5f2846b Merge branch 'main' into nickrolfe/overlay-deleted-files 2025-07-04 16:19:59 +02:00
Jeroen Ketema
5c9a401806 Merge pull request #19977 from jketema/ruby-typo
Ruby: Fix typo in query message
2025-07-04 16:09:22 +02:00
Jeroen Ketema
52bbfa30d2 Ruby: update expected test results 2025-07-04 15:32:07 +02:00
Jeroen Ketema
b3225cf7e3 Rubt: Fix typo in query message 2025-07-04 15:22:03 +02:00
Tom Hvitved
379c913ce3 Rust: Remove source vs library deduplication logic 2025-07-04 14:58:20 +02:00
Tom Hvitved
e33ddce79f Merge pull request #19847 from hvitved/rust/type-inference-explicit-args
Rust: Handle more explicit type arguments in type inference
2025-07-04 14:46:02 +02:00
Tom Hvitved
d1dd05e7bb Rust: Fix SSA inconsistencies 2025-07-04 14:43:10 +02:00
Jeroen Ketema
d010b6eb01 C++: Update expected test results 2025-07-04 14:28:17 +02:00
Arthur Baars
3d435ddca0 Merge branch 'main' into rust/type-inference-explicit-args 2025-07-04 14:17:52 +02:00
Jeroen Ketema
2908570ce9 C++: Do not consider expression results discardable when there is a conversion 2025-07-04 14:10:34 +02:00
Jeroen Ketema
b185cc8b95 C++: Factor out transparent conversions in their own predicate 2025-07-04 14:09:34 +02:00
Jeroen Ketema
e68d10119b C++: Fix typo in comment 2025-07-04 14:09:09 +02:00
Jeroen Ketema
799f33eb3a C++: Add more postfix-crement tests 2025-07-04 14:08:29 +02:00
Mathias Vorreiter Pedersen
9dd3b33410 Merge pull request #19973 from MathiasVP/add-glibc-models
C++: Add `glibc` flow summaries
2025-07-04 10:21:14 +01:00
Tom Hvitved
2b2bd17d10 Rust: Add more SSA tests 2025-07-04 10:47:56 +02:00
Kasper Svendsen
785e0273f2 Merge pull request #19968 from kaspersv/kaspersv/overlay-java-getastrictancestor-caller
Overlay: Mark `RefType.getAStrictAncestor`` overlay[caller?]`
2025-07-04 09:38:02 +02:00
Mathias Vorreiter Pedersen
cda671711f C++: Add change note. 2025-07-04 00:05:41 +01:00
Mathias Vorreiter Pedersen
24728a3417 C++: Accept test changes. 2025-07-04 00:03:42 +01:00
Mathias Vorreiter Pedersen
e89662beb7 C++: Add glibc flow summaries. 2025-07-03 18:53:18 +01:00
Aditya Sharad
6124940f55 Merge pull request #19893 from github/changedocs/2.22.1
Add changelog entry for CodeQL CLI version 2.22.1
2025-07-03 10:21:12 -07:00
Jeroen Ketema
da924efedb Merge pull request #19970 from jketema/incr
C++: Add test showing we miss the operands of postfix crement in dataflow
2025-07-03 17:16:00 +02:00
Jeroen Ketema
5b26a426dc C++: Add test showing we miss the operands of postfix crement in dataflow 2025-07-03 16:49:37 +02:00
Mathias Vorreiter Pedersen
56490732bd Merge pull request #19969 from MathiasVP/add-glibc-to-bulk-generation-targets
C++: Add glibc to the list of bulk generation targets
2025-07-03 15:12:11 +01:00
Geoffrey White
831509539b Merge pull request #19934 from geoffw0/models0
Rust: Update legacy MaD models 1
2025-07-03 14:24:21 +01:00
Kasper Svendsen
de71758236 Merge pull request #19962 from kaspersv/kaspersv/overlay-java-local-TC-fixes
Overlay: Fix Java overlay compilation regressions
2025-07-03 15:03:02 +02:00
Paolo Tranquilli
8fda879461 Merge pull request #19967 from github/redsun82/format
Rust: format
2025-07-03 14:55:56 +02:00
Paolo Tranquilli
dee1ec31ee Rust: format 2025-07-03 14:42:38 +02:00
Nick Rolfe
d8574a6919 Ruby: use overlayChangedFiles extensional in discard predicates 2025-07-03 12:44:15 +01:00
Nick Rolfe
ba01a70e0a Rust: add upgrade scripts for overlayChangedFiles dbscheme addition 2025-07-03 12:44:14 +01:00
Nick Rolfe
ab74946e26 Ruby: add upgrade scripts for overlayChangedFiles dbscheme addition 2025-07-03 12:44:13 +01:00
Nick Rolfe
a02aabe797 Java: add upgrade scripts for overlayChangedFiles dbscheme addition 2025-07-03 12:44:12 +01:00
Nick Rolfe
838290d670 Ruby: bump overlay_support_version 2025-07-03 12:44:11 +01:00
Nick Rolfe
72b4e67477 Java/Ruby/Rust/QL: add overlayChangedFiles relation to dbscheme 2025-07-03 12:44:09 +01:00
Jeroen Ketema
a4de3110ae Merge pull request #15233 from jketema/uncomment-function-kind
C++: Uncomment cases in the dbscheme
2025-07-03 13:37:55 +02:00
Kasper Svendsen
dd8af3baf7 Overlay: Mark RefType.getAStrictAncestor overlay[caller?] 2025-07-03 12:23:20 +02:00
Michael Nebel
11c4a638bc Quality tags: Clarify the quality sub-category tagging policy. 2025-07-03 12:19:41 +02:00
Michael Nebel
aefd941135 Java/Javascript: Fix violations. 2025-07-03 11:56:33 +02:00
Michael Nebel
f810e17d9e Ql4Ql: Address review comments and update expected test output. 2025-07-03 11:56:32 +02:00
Michael Nebel
b79e2dd0ba Ql4Ql: Add some more quality tag testcases. 2025-07-03 11:56:30 +02:00
Michael Nebel
f58064e119 Ql4Ql: Address review comments. 2025-07-03 11:56:29 +02:00
Michael Nebel
af1c4e0896 Ql4Ql: Share the definition of TestFile between multiple tests. 2025-07-03 11:56:27 +02:00
Michael Nebel
60a1d02357 Ql4Ql: Add MissingQualityMetadata test. 2025-07-03 11:56:26 +02:00
Michael Nebel
e00b5351a4 Ql4Ql: Add a check for quality tag consistency. 2025-07-03 11:56:25 +02:00
Michael Nebel
c46b528c05 Ql4Ql: Add some quality tag testcases. 2025-07-03 11:56:23 +02:00
Michael Nebel
cce17743bb Ql4Ql: Re-factor the ql/mising-security-metadata query. 2025-07-03 11:56:22 +02:00
Tom Hvitved
2924faf7f8 Rust: Tweak illFormedTypeMention consistency check 2025-07-03 11:56:16 +02:00
Asger F
552e156468 Merge pull request #19640 from asgerf/js/no-type-extraction
JS: Disable type extraction
2025-07-03 11:18:42 +02:00
Geoffrey White
1289f1483f Merge pull request #19961 from geoffw0/locspeed
Rust: Speed up use of Location.contains
2025-07-03 10:16:39 +01:00
Asger F
bb45d0632b Merge branch 'main' into approximate-related-location 2025-07-03 10:53:07 +02:00
Kasper Svendsen
649091c0ed Fix java/local-temp-file-or-directory-information-disclosure overlay compilation regression 2025-07-03 10:47:33 +02:00
Kasper Svendsen
425448a10a Fix java/netty-http-request-or-response-splitting overlay compilation regression 2025-07-03 10:47:33 +02:00
Paolo Tranquilli
064708620f Merge pull request #19861 from github/redsun82/rust-reorg-ast-generator
Rust: refactor `ast-generator` to have all customization at the start
2025-07-03 10:09:17 +02:00
Asger F
98319ce2ad Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
2025-07-03 08:44:33 +02:00
Geoffrey White
9728dbb247 Rust: Speed up use of Location.contains / isFromMacroExpansion. 2025-07-02 21:16:21 +01:00
Mathias Vorreiter Pedersen
d4bc38462f C++: Add glibc to the list of bulk generation targets. 2025-07-02 18:59:15 +01:00
Mathias Vorreiter Pedersen
5e8b12a08b Merge pull request #19955 from MathiasVP/flow-through-create-thread
C++: Add flow summaries for `CreateThread` and friends
2025-07-02 18:27:36 +01:00
Paolo Tranquilli
c10d89927d Merge pull request #19945 from github/redsun82/fix-expansion-in-lib
Rust: fix macro expansion in library code
2025-07-02 18:11:36 +02:00
Paolo Tranquilli
2fffa9db3c Merge pull request #19781 from github/redsun82/go-internal-tests
Go: remove language tests from workflows
2025-07-02 18:10:44 +02:00
Paolo Tranquilli
72bfbacaaf Merge branch 'main' into redsun82/go-internal-tests 2025-07-02 16:21:26 +02:00
Mathias Vorreiter Pedersen
e6104981ff C++: Add change note. 2025-07-02 14:32:17 +01:00
Mathias Vorreiter Pedersen
76678ef3d2 C++: Accept test changes. 2025-07-02 14:24:16 +01:00
Mathias Vorreiter Pedersen
f825904ee0 C++: Add flow models for 'CreateProcess' and friends. 2025-07-02 14:18:36 +01:00
Mathias Vorreiter Pedersen
5684ca5d51 C++: Add tests with 'CreateProcess' and fiends demonstrating missing flow. 2025-07-02 14:18:34 +01:00
Asger F
4a2d795076 Shared: Make approximate location filtering the default behaviour 2025-07-02 14:41:02 +02:00
Asger F
82d190f4bf Java: use approximate related sink locations in polynomial redos 2025-07-02 14:40:56 +02:00
Asger F
a46b5f9529 Python: enable diff-informedness for poly redos using approximate related locations 2025-07-02 14:39:42 +02:00
Asger F
d65da1f8a1 Ruby: enable for PolyReDos but document why it still doesnt work 2025-07-02 14:39:41 +02:00
Asger F
8b345518f4 Shared: Add approximate version of getASelected{Source,Sink}Location 2025-07-02 14:39:39 +02:00
Asger F
d1b4172486 Shared: Factor out some helper predicates in alert filtering 2025-07-02 14:39:37 +02:00
Asger F
d85838477e JS: Update Nest model
An external contribution added more uses of the now-deprecated getType()
predicate while this PR was open.
2025-07-02 14:11:31 +02:00
Asger F
47a90c8b32 Merge branch 'main' into js/no-type-extraction 2025-07-02 13:18:05 +02:00
Paolo Tranquilli
c70198e4e4 Rust: change dummy macro call expansion 2025-07-02 12:25:10 +02:00
Tom Hvitved
f7195f04f8 Rust: Handle more explicit type arguments in type inference 2025-07-02 11:37:05 +02:00
Tom Hvitved
b6d5225bf5 Rust: Add more type inference tests 2025-07-02 11:37:03 +02:00
Paolo Tranquilli
bf09c92528 Rust: add location to dummy MacroCalls in library mode 2025-07-02 10:33:53 +02:00
Paolo Tranquilli
63ccbec933 Rust: accept language test changes 2025-07-02 10:19:52 +02:00
Geoffrey White
3e11dbded0 Rust: Accept test changes. 2025-07-02 09:08:15 +01:00
Asger F
4b2025d2c4 JS: Remove obsolete unit tests 2025-07-02 09:54:18 +02:00
Asger F
2aad14771c JS: Remove TypeScriptMode 2025-07-02 08:39:17 +02:00
Geoffrey White
7ef5586cc7 Rust: Translate more legacy models -> new models (mostly guesswork for these last few cases). 2025-07-01 17:15:26 +01:00
Geoffrey White
e56b9debf8 Rust: Fix mistake. 2025-07-01 16:55:06 +01:00
Geoffrey White
3027f75617 Rust: Translate more legacy models -> new models (from data). 2025-07-01 16:37:14 +01:00
Paolo Tranquilli
223f0c8684 Rust: fix macro expansion in library code
There was a mismatch between a `self.macro_context_level += 1` and the
corresponding `self.macro_context_level -= 1`, which resulted in an
`usize` underflow (panic in debug mode, wrong behaviour in release
mode).

This fixes it and adds a relevant assertion and test. In order to
properly test library mode extraction, a special option enforcing that
on source code as well is added.
2025-07-01 17:31:26 +02:00
Geoffrey White
cb6640474e Rust: Translate more legacy models -> new models (from data + manual extrapolation). 2025-07-01 13:21:52 +01:00
Geoffrey White
59b74871c2 Rust: Accept regressions. 2025-06-30 21:13:44 +01:00
Geoffrey White
91072477b7 Rust: Trivial test changes. 2025-06-30 20:15:18 +01:00
Geoffrey White
8f56f8d5a0 Rust: Translate some legacy models -> new models. 2025-06-30 17:47:59 +01:00
Paolo Tranquilli
fa14f9540b Merge branch 'main' into redsun82/go-internal-tests 2025-06-30 17:38:59 +02:00
Florin Coada
0103ee2872 Add changelog entry for CodeQL CLI version 2.22.1 2025-06-26 15:50:23 +01:00
Asger F
5289e4f424 JS: Fix a bug in a unit test
The 'extractTypeScriptFiles' override did not incorporate the file type and one of our unit tests was expecting this. The test was previously passing for the wrong reasons.
2025-06-25 14:31:31 +02:00
Asger F
02cdde1447 JS: Fix imprecise condition 2025-06-25 14:31:28 +02:00
Asger F
aef362152e JS: Change notes 2025-06-25 14:31:25 +02:00
Asger F
c8b2674206 JS: Add support for index expressions 2025-06-25 14:31:22 +02:00
Asger F
b1d4776b17 JS: Handle name resolution through dynamic imports 2025-06-25 14:31:20 +02:00
Asger F
7cc248703a JS: Add test for dynamic imports 2025-06-25 14:31:17 +02:00
Asger F
92dd5bd1f4 JS: Add deprecation comment to qldoc 2025-06-25 14:31:14 +02:00
Asger F
488da145e8 JS: Don't try to augment invalid files
This check existed on the code path for full type extraction, but not for plain single-file extraction.
2025-06-25 14:31:11 +02:00
Asger F
74b817b642 JS: Remove code path for TypeScript full extraction 2025-06-25 14:31:05 +02:00
Paolo Tranquilli
a72ae9c960 Rust: refactor ast-generator to have all customization at the start 2025-06-24 10:42:16 +02:00
Asger F
8efa38be79 JS: Change default TypeScript extraction mode to basic 2025-06-23 12:55:20 +02:00
Asger F
e323833bc3 JS: Fix qldoc coverage 2025-06-23 12:55:19 +02:00
Asger F
07f84a5add JS: Remove an unnecessary import 2025-06-23 12:55:18 +02:00
Asger F
1cab99290e JS: Remove unneeded integration test 2025-06-23 12:55:16 +02:00
Asger F
f5f12c2f81 JS: Delete or simplify TypeScript type-specific tests 2025-06-23 12:55:15 +02:00
Asger F
ee9c4fa763 JS: Deprecate everything that depends on type extraction 2025-06-23 12:55:14 +02:00
Asger F
f5ac3fd611 JS: Remove old metric-meta query TypedExprs.ql
This was used in the very old dist-compare tool, but has no use anymore
2025-06-23 12:55:12 +02:00
Asger F
6d389c31c7 JS: Update an outdated QLDoc comment 2025-06-23 12:55:11 +02:00
Asger F
fcb6882f16 JS: Update API usage in MissingAwait 2025-06-23 12:55:09 +02:00
Asger F
e459884b69 JS: Update API usage in ViewComponentInput 2025-06-23 12:55:08 +02:00
Asger F
fb92d9b034 JS: Update type usage in UnreachableMethodOverloads
This query depended on the cons-hashing performed by type extraction to determine if two types are the same.

This is not trivial to restore, but not important enough to reimplement right now, so for now just simplifying the query's ability to recognise that two types are the same.
2025-06-23 12:55:06 +02:00
Asger F
8b2a424fb0 JS: Update type usage use in Express model 2025-06-23 12:55:05 +02:00
Asger F
b71d09630a JS: Update type usage in Electron model 2025-06-23 12:55:03 +02:00
Asger F
ace8b09a36 JS: Update type usage in ClassValidator.qll 2025-06-23 12:55:01 +02:00
Asger F
9d4c38b5f1 JS: Update type usage in definitions.qll 2025-06-23 12:54:59 +02:00
Asger F
17a687b38f JS: Update type usage in Nest library model 2025-06-23 12:54:57 +02:00
Asger F
b82e84930c JS: Add public API 2025-06-23 12:54:56 +02:00
Asger F
2a0c7c8801 JS: Add classHasGlobalName into NameResolution 2025-06-23 12:54:55 +02:00
Asger F
de9dab9ba3 JS: Move some predicates into NameResolution 2025-06-23 12:54:53 +02:00
Paolo Tranquilli
0d803698ac Go: remove language tests from workflows
Now that they are run internally using QLucie.
2025-06-16 14:01:40 +02:00
Lindsay Simpkins
f96a250ffc fix qhelp files 2025-06-09 18:37:16 -04:00
Adnan Khan
aca3d897a2 Merge branch 'main' into patch-1 2025-05-19 08:52:56 -04:00
Adnan Khan
a9c4d6f383 Fix escaping. 2025-04-25 15:00:14 -04:00
Adnan Khan
38f00775bd Exclude artifacts downloaded to runner temp. 2025-04-25 14:49:01 -04:00
1006 changed files with 73733 additions and 26909 deletions

View File

@@ -1,35 +0,0 @@
name: "Go: Run Tests - Other OS"
on:
pull_request:
paths:
- "go/**"
- "!go/documentation/**"
- "!go/ql/**" # don't run other-os if only ql/ files changed
- .github/workflows/go-tests-other-os.yml
- .github/actions/**
- codeql-workspace.yml
- MODULE.bazel
- .bazelrc
- misc/bazel/**
permissions:
contents: read
jobs:
test-mac:
name: Test MacOS
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Run tests
uses: ./go/actions/test
test-win:
name: Test Windows
runs-on: windows-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Run tests
uses: ./go/actions/test

View File

@@ -1,22 +0,0 @@
name: "Go: Run RTJO Tests"
on:
pull_request:
types:
- labeled
permissions:
contents: read
jobs:
test-linux:
if: "github.repository_owner == 'github' && github.event.label.name == 'Run: RTJO Language Tests'"
name: RTJO Test Linux (Ubuntu)
runs-on: ubuntu-latest-xl
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Run tests
uses: ./go/actions/test
with:
run-code-checks: true
dynamic-join-order-mode: all

View File

@@ -1,20 +1,9 @@
name: "Go: Run Tests"
on:
push:
paths:
- "go/**"
- "!go/documentation/**"
- "shared/**"
- .github/workflows/go-tests.yml
- .github/actions/**
- codeql-workspace.yml
branches:
- main
- "rc/*"
pull_request:
paths:
- "go/**"
- "!go/documentation/**"
- "!go/documentation/**"
- "shared/**"
- .github/workflows/go-tests.yml
- .github/actions/**

View File

@@ -37,6 +37,7 @@ bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True
# the versions there are canonical, the versions here are used for CI in github/codeql, as well as for the vendoring of dependencies.
RUST_EDITION = "2024"
# run buildutils-internal/scripts/fill-rust-sha256s.py when updating (internal repo)
RUST_VERSION = "1.86.0"
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
@@ -47,6 +48,29 @@ rust.toolchain(
"x86_64-apple-darwin",
"aarch64-apple-darwin",
],
# generated by buildutils-internal/scripts/fill-rust-sha256s.py (internal repo)
sha256s = {
"rustc-1.86.0-x86_64-unknown-linux-gnu.tar.xz": "4438b809ce4a083af31ed17aeeedcc8fc60ccffc0625bef1926620751b6989d7",
"rustc-1.86.0-x86_64-apple-darwin.tar.xz": "42b76253626febb7912541a30d3379f463dec89581aad4cb72c6c04fb5a71dc5",
"rustc-1.86.0-aarch64-apple-darwin.tar.xz": "23b8f52102249a47ab5bc859d54c9a3cb588a3259ba3f00f557d50edeca4fde9",
"rustc-1.86.0-x86_64-pc-windows-msvc.tar.xz": "fdde839fea274529a31e51eb85c6df1782cc8479c9d1bc24e2914d66a0de41ab",
"clippy-1.86.0-x86_64-unknown-linux-gnu.tar.xz": "02aaff2c1407d2da8dba19aa4970dd873e311902b120a66cbcdbe51eb8836edf",
"clippy-1.86.0-x86_64-apple-darwin.tar.xz": "bb85efda7bbffaf124867f5ca36d50932b1e8f533c62ee923438afb32ff8fe9a",
"clippy-1.86.0-aarch64-apple-darwin.tar.xz": "239fa3a604b124f0312f2af08537874a1227dba63385484b468cca62e7c4f2f2",
"clippy-1.86.0-x86_64-pc-windows-msvc.tar.xz": "d00498f47d49219f032e2c5eeebdfc3d32317c0dc3d3fd7125327445bc482cb4",
"cargo-1.86.0-x86_64-unknown-linux-gnu.tar.xz": "c5c1590f7e9246ad9f4f97cfe26ffa92707b52a769726596a9ef81565ebd908b",
"cargo-1.86.0-x86_64-apple-darwin.tar.xz": "af163eb02d1a178044d1b4f2375960efd47130f795f6e33d09e345454bb26f4e",
"cargo-1.86.0-aarch64-apple-darwin.tar.xz": "3cb13873d48c3e1e4cc684d42c245226a11fba52af6b047c3346ed654e7a05c0",
"cargo-1.86.0-x86_64-pc-windows-msvc.tar.xz": "e57a9d89619b5604899bac443e68927bdd371e40f2e03e18950b6ceb3eb67966",
"llvm-tools-1.86.0-x86_64-unknown-linux-gnu.tar.xz": "282145ab7a63c98b625856f44b905b4dc726b497246b824632a5790debe95a78",
"llvm-tools-1.86.0-x86_64-apple-darwin.tar.xz": "b55706e92f7da989207c50c13c7add483a9fedd233bc431b106eca2a8f151ec9",
"llvm-tools-1.86.0-aarch64-apple-darwin.tar.xz": "04d3618c686845853585f036e3211eb9e18f2d290f4610a7a78bdc1fcce1ebd9",
"llvm-tools-1.86.0-x86_64-pc-windows-msvc.tar.xz": "721a17cc8dc219177e4277a3592253934ef08daa1e1b12eda669a67d15fad8dd",
"rust-std-1.86.0-x86_64-unknown-linux-gnu.tar.xz": "67be7184ea388d8ce0feaf7fdea46f1775cfc2970930264343b3089898501d37",
"rust-std-1.86.0-x86_64-apple-darwin.tar.xz": "3b1140d54870a080080e84700143f4a342fbd02a410a319b05d9c02e7dcf44cc",
"rust-std-1.86.0-aarch64-apple-darwin.tar.xz": "0fb121fb3b8fa9027d79ff598500a7e5cd086ddbc3557482ed3fdda00832c61b",
"rust-std-1.86.0-x86_64-pc-windows-msvc.tar.xz": "3d5354b7b9cb950b58bff3fce18a652aa374bb30c8f70caebd3bd0b43cb41a33",
},
versions = [RUST_VERSION],
)
use_repo(rust, "rust_toolchains")

View File

@@ -1,3 +1,9 @@
## 0.4.13
### Bug Fixes
* The `actions/artifact-poisoning/critical` and `actions/artifact-poisoning/medium` queries now exclude artifacts downloaded to `$[{ runner.temp }}` in addition to `/tmp`.
## 0.4.12
### Minor Analysis Improvements

View File

@@ -0,0 +1,5 @@
## 0.4.13
### Bug Fixes
* The `actions/artifact-poisoning/critical` and `actions/artifact-poisoning/medium` queries now exclude artifacts downloaded to `$[{ runner.temp }}` in addition to `/tmp`.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.4.12
lastReleaseVersion: 0.4.13

View File

@@ -72,7 +72,7 @@ string normalizePath(string path) {
then result = path
else
// foo -> GITHUB_WORKSPACE/foo
if path.regexpMatch("^[^/~].*")
if path.regexpMatch("^[^$/~].*")
then result = "GITHUB_WORKSPACE/" + path.regexpReplaceAll("/$", "")
else
// ~/foo -> ~/foo

View File

@@ -262,8 +262,10 @@ class ArtifactPoisoningSink extends DataFlow::Node {
ArtifactPoisoningSink() {
download.getAFollowingStep() = poisonable and
// excluding artifacts downloaded to /tmp
// excluding artifacts downloaded to the temporary directory
not download.getPath().regexpMatch("^/tmp.*") and
not download.getPath().regexpMatch("^\\$\\{\\{\\s*runner\\.temp\\s*}}.*") and
not download.getPath().regexpMatch("^\\$RUNNER_TEMP.*") and
(
poisonable.(Run).getScript() = this.asExpr() and
(

View File

@@ -1,5 +1,5 @@
name: codeql/actions-all
version: 0.4.13-dev
version: 0.4.13
library: true
warnOnImplicitThis: true
dependencies:

View File

@@ -1,3 +1,7 @@
## 0.6.5
No user-facing changes.
## 0.6.4
No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.6.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.6.4
lastReleaseVersion: 0.6.5

View File

@@ -1,5 +1,5 @@
name: codeql/actions-queries
version: 0.6.5-dev
version: 0.6.5
library: false
warnOnImplicitThis: true
groups: [actions, queries]

View File

@@ -0,0 +1,19 @@
on:
workflow_run:
workflows:
- Benchmark
types:
- completed
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download From PR
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
path: ${{ runner.temp }}/artifacts/
- run: npm install

View File

@@ -0,0 +1,19 @@
on:
workflow_run:
workflows:
- Benchmark
types:
- completed
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download From PR
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
path: /tmp/artifacts/
- run: npm install

View File

@@ -0,0 +1,19 @@
on:
workflow_run:
workflows:
- Benchmark
types:
- completed
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download From PR
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
path: $RUNNER_TEMP/artifacts/
- run: npm install

View File

@@ -0,0 +1,18 @@
on:
workflow_run:
workflows:
- Benchmark
types:
- completed
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download From PR
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- run: npm install

View File

@@ -0,0 +1,19 @@
on:
workflow_run:
workflows:
- Benchmark
types:
- completed
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download From PR
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
path: ${{ runner.temp }}/artifacts/
- run: npm install

View File

@@ -13,6 +13,7 @@ edges
| .github/workflows/artifactpoisoning42.yml:13:9:21:6 | Run Step | .github/workflows/artifactpoisoning42.yml:22:14:22:18 | ./cmd | provenance | Config |
| .github/workflows/artifactpoisoning71.yml:9:9:16:6 | Uses Step | .github/workflows/artifactpoisoning71.yml:17:14:18:40 | sed -f config foo.md > bar.md\n | provenance | Config |
| .github/workflows/artifactpoisoning81.yml:28:9:31:6 | Uses Step | .github/workflows/artifactpoisoning81.yml:31:14:31:27 | python test.py | provenance | Config |
| .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | .github/workflows/artifactpoisoning96.yml:18:14:18:24 | npm install | provenance | Config |
| .github/workflows/artifactpoisoning101.yml:10:9:16:6 | Uses Step | .github/workflows/artifactpoisoning101.yml:17:14:19:59 | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | provenance | Config |
| .github/workflows/test18.yml:12:15:33:12 | Uses Step | .github/workflows/test18.yml:36:15:40:58 | Uses Step | provenance | Config |
| .github/workflows/test25.yml:22:9:32:6 | Uses Step: downloadBuildScan | .github/workflows/test25.yml:39:14:40:45 | ./gradlew buildScanPublishPrevious\n | provenance | Config |
@@ -44,6 +45,8 @@ nodes
| .github/workflows/artifactpoisoning81.yml:31:14:31:27 | python test.py | semmle.label | python test.py |
| .github/workflows/artifactpoisoning92.yml:28:9:29:6 | Uses Step | semmle.label | Uses Step |
| .github/workflows/artifactpoisoning92.yml:29:14:29:26 | make snapshot | semmle.label | make snapshot |
| .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | semmle.label | Uses Step |
| .github/workflows/artifactpoisoning96.yml:18:14:18:24 | npm install | semmle.label | npm install |
| .github/workflows/artifactpoisoning101.yml:10:9:16:6 | Uses Step | semmle.label | Uses Step |
| .github/workflows/artifactpoisoning101.yml:17:14:19:59 | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | semmle.label | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n |
| .github/workflows/test18.yml:12:15:33:12 | Uses Step | semmle.label | Uses Step |
@@ -66,6 +69,7 @@ subpaths
| .github/workflows/artifactpoisoning81.yml:31:14:31:27 | python test.py | .github/workflows/artifactpoisoning81.yml:28:9:31:6 | Uses Step | .github/workflows/artifactpoisoning81.yml:31:14:31:27 | python test.py | Potential artifact poisoning in $@, which may be controlled by an external user ($@). | .github/workflows/artifactpoisoning81.yml:31:14:31:27 | python test.py | python test.py | .github/workflows/artifactpoisoning81.yml:3:5:3:23 | pull_request_target | pull_request_target |
| .github/workflows/artifactpoisoning92.yml:28:9:29:6 | Uses Step | .github/actions/download-artifact-2/action.yaml:6:7:25:4 | Uses Step | .github/workflows/artifactpoisoning92.yml:28:9:29:6 | Uses Step | Potential artifact poisoning in $@, which may be controlled by an external user ($@). | .github/workflows/artifactpoisoning92.yml:28:9:29:6 | Uses Step | Uses Step | .github/workflows/artifactpoisoning92.yml:3:3:3:14 | workflow_run | workflow_run |
| .github/workflows/artifactpoisoning92.yml:29:14:29:26 | make snapshot | .github/actions/download-artifact-2/action.yaml:6:7:25:4 | Uses Step | .github/workflows/artifactpoisoning92.yml:29:14:29:26 | make snapshot | Potential artifact poisoning in $@, which may be controlled by an external user ($@). | .github/workflows/artifactpoisoning92.yml:29:14:29:26 | make snapshot | make snapshot | .github/workflows/artifactpoisoning92.yml:3:3:3:14 | workflow_run | workflow_run |
| .github/workflows/artifactpoisoning96.yml:18:14:18:24 | npm install | .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | .github/workflows/artifactpoisoning96.yml:18:14:18:24 | npm install | Potential artifact poisoning in $@, which may be controlled by an external user ($@). | .github/workflows/artifactpoisoning96.yml:18:14:18:24 | npm install | npm install | .github/workflows/artifactpoisoning96.yml:2:3:2:14 | workflow_run | workflow_run |
| .github/workflows/artifactpoisoning101.yml:17:14:19:59 | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | .github/workflows/artifactpoisoning101.yml:10:9:16:6 | Uses Step | .github/workflows/artifactpoisoning101.yml:17:14:19:59 | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | Potential artifact poisoning in $@, which may be controlled by an external user ($@). | .github/workflows/artifactpoisoning101.yml:17:14:19:59 | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | .github/workflows/artifactpoisoning101.yml:4:3:4:21 | pull_request_target | pull_request_target |
| .github/workflows/test18.yml:36:15:40:58 | Uses Step | .github/workflows/test18.yml:12:15:33:12 | Uses Step | .github/workflows/test18.yml:36:15:40:58 | Uses Step | Potential artifact poisoning in $@, which may be controlled by an external user ($@). | .github/workflows/test18.yml:36:15:40:58 | Uses Step | Uses Step | .github/workflows/test18.yml:3:5:3:16 | workflow_run | workflow_run |
| .github/workflows/test25.yml:39:14:40:45 | ./gradlew buildScanPublishPrevious\n | .github/workflows/test25.yml:22:9:32:6 | Uses Step: downloadBuildScan | .github/workflows/test25.yml:39:14:40:45 | ./gradlew buildScanPublishPrevious\n | Potential artifact poisoning in $@, which may be controlled by an external user ($@). | .github/workflows/test25.yml:39:14:40:45 | ./gradlew buildScanPublishPrevious\n | ./gradlew buildScanPublishPrevious\n | .github/workflows/test25.yml:2:3:2:14 | workflow_run | workflow_run |

View File

@@ -13,6 +13,7 @@ edges
| .github/workflows/artifactpoisoning42.yml:13:9:21:6 | Run Step | .github/workflows/artifactpoisoning42.yml:22:14:22:18 | ./cmd | provenance | Config |
| .github/workflows/artifactpoisoning71.yml:9:9:16:6 | Uses Step | .github/workflows/artifactpoisoning71.yml:17:14:18:40 | sed -f config foo.md > bar.md\n | provenance | Config |
| .github/workflows/artifactpoisoning81.yml:28:9:31:6 | Uses Step | .github/workflows/artifactpoisoning81.yml:31:14:31:27 | python test.py | provenance | Config |
| .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | .github/workflows/artifactpoisoning96.yml:18:14:18:24 | npm install | provenance | Config |
| .github/workflows/artifactpoisoning101.yml:10:9:16:6 | Uses Step | .github/workflows/artifactpoisoning101.yml:17:14:19:59 | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | provenance | Config |
| .github/workflows/test18.yml:12:15:33:12 | Uses Step | .github/workflows/test18.yml:36:15:40:58 | Uses Step | provenance | Config |
| .github/workflows/test25.yml:22:9:32:6 | Uses Step: downloadBuildScan | .github/workflows/test25.yml:39:14:40:45 | ./gradlew buildScanPublishPrevious\n | provenance | Config |
@@ -44,6 +45,8 @@ nodes
| .github/workflows/artifactpoisoning81.yml:31:14:31:27 | python test.py | semmle.label | python test.py |
| .github/workflows/artifactpoisoning92.yml:28:9:29:6 | Uses Step | semmle.label | Uses Step |
| .github/workflows/artifactpoisoning92.yml:29:14:29:26 | make snapshot | semmle.label | make snapshot |
| .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | semmle.label | Uses Step |
| .github/workflows/artifactpoisoning96.yml:18:14:18:24 | npm install | semmle.label | npm install |
| .github/workflows/artifactpoisoning101.yml:10:9:16:6 | Uses Step | semmle.label | Uses Step |
| .github/workflows/artifactpoisoning101.yml:17:14:19:59 | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n | semmle.label | PR_NUMBER=$(./get_pull_request_number.sh pr_number.txt)\necho "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT \n |
| .github/workflows/test18.yml:12:15:33:12 | Uses Step | semmle.label | Uses Step |

View File

@@ -51,6 +51,16 @@ edges
| .github/workflows/artifactpoisoning92.yml:19:9:25:6 | Run Step: metadata | .github/workflows/artifactpoisoning92.yml:25:9:28:6 | Uses Step |
| .github/workflows/artifactpoisoning92.yml:25:9:28:6 | Uses Step | .github/workflows/artifactpoisoning92.yml:28:9:29:6 | Uses Step |
| .github/workflows/artifactpoisoning92.yml:28:9:29:6 | Uses Step | .github/workflows/artifactpoisoning92.yml:29:9:29:27 | Run Step |
| .github/workflows/artifactpoisoning93.yml:12:9:13:6 | Uses Step | .github/workflows/artifactpoisoning93.yml:13:9:19:6 | Uses Step |
| .github/workflows/artifactpoisoning93.yml:13:9:19:6 | Uses Step | .github/workflows/artifactpoisoning93.yml:19:9:19:24 | Run Step |
| .github/workflows/artifactpoisoning94.yml:12:9:13:6 | Uses Step | .github/workflows/artifactpoisoning94.yml:13:9:19:6 | Uses Step |
| .github/workflows/artifactpoisoning94.yml:13:9:19:6 | Uses Step | .github/workflows/artifactpoisoning94.yml:19:9:19:24 | Run Step |
| .github/workflows/artifactpoisoning95.yml:12:9:13:6 | Uses Step | .github/workflows/artifactpoisoning95.yml:13:9:19:6 | Uses Step |
| .github/workflows/artifactpoisoning95.yml:13:9:19:6 | Uses Step | .github/workflows/artifactpoisoning95.yml:19:9:19:24 | Run Step |
| .github/workflows/artifactpoisoning96.yml:12:9:13:6 | Uses Step | .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step |
| .github/workflows/artifactpoisoning96.yml:13:9:18:6 | Uses Step | .github/workflows/artifactpoisoning96.yml:18:9:18:24 | Run Step |
| .github/workflows/artifactpoisoning97.yml:12:9:13:6 | Uses Step | .github/workflows/artifactpoisoning97.yml:13:9:19:6 | Uses Step |
| .github/workflows/artifactpoisoning97.yml:13:9:19:6 | Uses Step | .github/workflows/artifactpoisoning97.yml:19:9:19:25 | Run Step |
| .github/workflows/artifactpoisoning101.yml:10:9:16:6 | Uses Step | .github/workflows/artifactpoisoning101.yml:16:9:19:59 | Run Step: pr_number |
| .github/workflows/auto_ci.yml:20:9:27:6 | Uses Step | .github/workflows/auto_ci.yml:27:9:32:6 | Uses Step |
| .github/workflows/auto_ci.yml:27:9:32:6 | Uses Step | .github/workflows/auto_ci.yml:32:9:37:6 | Run Step |

View File

@@ -231,35 +231,10 @@
"java/ql/src/experimental/Security/CWE/CWE-400/LocalThreadResourceAbuse.qhelp",
"java/ql/src/experimental/Security/CWE/CWE-400/ThreadResourceAbuse.qhelp"
],
"CryptoAlgorithms Python/JS/Ruby": [
"javascript/ql/lib/semmle/javascript/security/CryptoAlgorithms.qll",
"python/ql/lib/semmle/python/concepts/CryptoAlgorithms.qll",
"ruby/ql/lib/codeql/ruby/security/CryptoAlgorithms.qll",
"rust/ql/lib/codeql/rust/security/CryptoAlgorithms.qll"
],
"CryptoAlgorithmNames Python/JS/Ruby": [
"javascript/ql/lib/semmle/javascript/security/internal/CryptoAlgorithmNames.qll",
"python/ql/lib/semmle/python/concepts/internal/CryptoAlgorithmNames.qll",
"ruby/ql/lib/codeql/ruby/security/internal/CryptoAlgorithmNames.qll",
"rust/ql/lib/codeql/rust/security/internal/CryptoAlgorithmNames.qll"
],
"SensitiveDataHeuristics Python/JS": [
"javascript/ql/lib/semmle/javascript/security/internal/SensitiveDataHeuristics.qll",
"python/ql/lib/semmle/python/security/internal/SensitiveDataHeuristics.qll",
"ruby/ql/lib/codeql/ruby/security/internal/SensitiveDataHeuristics.qll",
"swift/ql/lib/codeql/swift/security/internal/SensitiveDataHeuristics.qll",
"rust/ql/lib/codeql/rust/security/internal/SensitiveDataHeuristics.qll"
],
"IncompleteUrlSubstringSanitization": [
"javascript/ql/src/Security/CWE-020/IncompleteUrlSubstringSanitization.qll",
"ruby/ql/src/queries/security/cwe-020/IncompleteUrlSubstringSanitization.qll"
],
"Concepts Python/Ruby/JS": [
"python/ql/lib/semmle/python/internal/ConceptsShared.qll",
"ruby/ql/lib/codeql/ruby/internal/ConceptsShared.qll",
"javascript/ql/lib/semmle/javascript/internal/ConceptsShared.qll",
"rust/ql/lib/codeql/rust/internal/ConceptsShared.qll"
],
"ApiGraphModels": [
"javascript/ql/lib/semmle/javascript/frameworks/data/internal/ApiGraphModels.qll",
"ruby/ql/lib/codeql/ruby/frameworks/data/internal/ApiGraphModels.qll",

View File

@@ -2,6 +2,9 @@ language: cpp
strategy: dca
destination: cpp/ql/lib/ext/generated
targets:
- name: glibc
with-sinks: false
with-sources: false
- name: zlib
with-sinks: false
with-sources: false

View File

@@ -1,3 +1,20 @@
## 5.3.0
### Deprecated APIs
* The `UnknownDefaultLocation`, `UnknownExprLocation`, and `UnknownStmtLocation` classes have been deprecated. Use `UnknownLocation` instead.
### New Features
* Added a `isFinalValueOfParameter` predicate to `DataFlow::Node` which holds when a dataflow node represents the final value of an output parameter of a function.
### Minor Analysis Improvements
* The `FunctionWithWrappers` library (`semmle.code.cpp.security.FunctionWithWrappers`) no longer considers calls through function pointers as wrapper functions.
* The analysis of C/C++ code targeting 64-bit Arm platforms has been improved. This includes support for the Arm-specific builtin functions, support for the `arm_neon.h` header and Neon vector types, and support for the `fp8` scalar type. The `arm_sve.h` header and scalable vectors are only partially supported at this point.
* Added support for `__fp16 _Complex` and `__bf16 _Complex` types
* Added `sql-injection` sink models for the Oracle Call Interface (OCI) database library functions `OCIStmtPrepare` and `OCIStmtPrepare2`.
## 5.2.0
### Deprecated APIs

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* Added `sql-injection` sink models for the Oracle Call Interface (OCI) database library functions `OCIStmtPrepare` and `OCIStmtPrepare2`.

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* The analysis of C/C++ code targeting 64-bit Arm platforms has been improved. This includes support for the Arm-specific builtin functions, support for the `arm_neon.h` header and Neon vector types, and support for the `fp8` scalar type. The `arm_sve.h` header and scalable vectors are only partially supported at this point.

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* Added support for `__fp16 _Complex` and `__bf16 _Complex` types

View File

@@ -1,4 +0,0 @@
---
category: deprecated
---
* The `UnknownDefaultLocation`, `UnknownExprLocation`, and `UnknownStmtLocation` classes have been deprecated. Use `UnknownLocation` instead.

View File

@@ -0,0 +1,16 @@
## 5.3.0
### Deprecated APIs
* The `UnknownDefaultLocation`, `UnknownExprLocation`, and `UnknownStmtLocation` classes have been deprecated. Use `UnknownLocation` instead.
### New Features
* Added a `isFinalValueOfParameter` predicate to `DataFlow::Node` which holds when a dataflow node represents the final value of an output parameter of a function.
### Minor Analysis Improvements
* The `FunctionWithWrappers` library (`semmle.code.cpp.security.FunctionWithWrappers`) no longer considers calls through function pointers as wrapper functions.
* The analysis of C/C++ code targeting 64-bit Arm platforms has been improved. This includes support for the Arm-specific builtin functions, support for the `arm_neon.h` header and Neon vector types, and support for the `fp8` scalar type. The `arm_sve.h` header and scalable vectors are only partially supported at this point.
* Added support for `__fp16 _Complex` and `__bf16 _Complex` types
* Added `sql-injection` sink models for the Oracle Call Interface (OCI) database library functions `OCIStmtPrepare` and `OCIStmtPrepare2`.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 5.2.0
lastReleaseVersion: 5.3.0

View File

@@ -32,4 +32,8 @@ extensions:
- ["", "", False, "CommandLineToArgvA", "", "", "Argument[*0]", "ReturnValue[**]", "taint", "manual"]
- ["", "", False, "CommandLineToArgvW", "", "", "Argument[*0]", "ReturnValue[**]", "taint", "manual"]
# fileapi.h
- ["", "", False, "ReadFileEx", "", "", "Argument[*3].Field[@hEvent]", "Argument[4].Parameter[*2].Field[@hEvent]", "value", "manual"]
- ["", "", False, "ReadFileEx", "", "", "Argument[*3].Field[@hEvent]", "Argument[4].Parameter[*2].Field[@hEvent]", "value", "manual"]
# processthreadsapi.h
- ["", "", False, "CreateThread", "", "", "Argument[@3]", "Argument[2].Parameter[@0]", "value", "manual"]
- ["", "", False, "CreateRemoteThread", "", "", "Argument[@4]", "Argument[3].Parameter[@0]", "value", "manual"]
- ["", "", False, "CreateRemoteThreadEx", "", "", "Argument[@4]", "Argument[3].Parameter[@0]", "value", "manual"]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: summaryModel
data: # namespace, type, subtypes, name, signature, ext, input, output, kind, provenance
- ["", "", False, "pthread_create", "", "", "Argument[@3]", "Argument[2].Parameter[@0]", "value", "manual"]

View File

@@ -0,0 +1,11 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: summaryModel
data: # namespace, type, subtypes, name, signature, ext, input, output, kind, provenance
- ["std", "thread", True, "thread", "", "", "Argument[*@1]", "Argument[0].Parameter[@0]", "value", "manual"]
- ["std", "thread", True, "thread", "", "", "Argument[*@2]", "Argument[0].Parameter[@1]", "value", "manual"]
- ["std", "thread", True, "thread", "", "", "Argument[*@3]", "Argument[0].Parameter[@2]", "value", "manual"]
- ["std", "thread", True, "thread", "", "", "Argument[*@4]", "Argument[0].Parameter[@3]", "value", "manual"]
- ["std", "thread", True, "thread", "", "", "Argument[*@5]", "Argument[0].Parameter[@4]", "value", "manual"]

View File

@@ -1,5 +1,5 @@
name: codeql/cpp-all
version: 5.2.1-dev
version: 5.3.0
groups: cpp
dbscheme: semmlecode.cpp.dbscheme
extractor: cpp

View File

@@ -57,7 +57,9 @@ class RequiresExpr extends Expr, @requires_expr {
/**
* A C++ requirement in a requires expression.
*/
class RequirementExpr extends Expr { }
class RequirementExpr extends Expr {
RequirementExpr() { this.getParent() instanceof RequiresExpr }
}
/**
* A C++ simple requirement in a requires expression.
@@ -70,7 +72,6 @@ class RequirementExpr extends Expr { }
*/
class SimpleRequirementExpr extends RequirementExpr {
SimpleRequirementExpr() {
this.getParent() instanceof RequiresExpr and
not this instanceof TypeRequirementExpr and
not this instanceof CompoundRequirementExpr and
not this instanceof NestedRequirementExpr
@@ -89,8 +90,6 @@ class SimpleRequirementExpr extends RequirementExpr {
* with `T` a template parameter, then `typename T::a_field;` is a type requirement.
*/
class TypeRequirementExpr extends RequirementExpr, TypeName {
TypeRequirementExpr() { this.getParent() instanceof RequiresExpr }
override string getAPrimaryQlClass() { result = "TypeRequirementExpr" }
}
@@ -140,7 +139,7 @@ class CompoundRequirementExpr extends RequirementExpr, @compound_requirement {
* with `T` a template parameter, then `requires std::is_same<T, int>::value;` is
* a nested requirement.
*/
class NestedRequirementExpr extends Expr, @nested_requirement {
class NestedRequirementExpr extends RequirementExpr, @nested_requirement {
override string toString() { result = "requires ..." }
override string getAPrimaryQlClass() { result = "NestedRequirementExpr" }
@@ -163,7 +162,7 @@ class NestedRequirementExpr extends Expr, @nested_requirement {
* then `C<int, 1>` is a concept id expression that refers to
* the concept `C`.
*/
class ConceptIdExpr extends RequirementExpr, @concept_id {
class ConceptIdExpr extends Expr, @concept_id {
override string toString() {
result = this.getConcept().getName() + "<...>"
or

View File

@@ -1382,16 +1382,89 @@ predicate neverSkipInPathGraph(Node n) {
exists(n.asIndirectDefinition())
}
class LambdaCallKind = Unit;
private newtype TLambdaCallKind =
TFunctionPointer() or
TFunctor()
class LambdaCallKind extends TLambdaCallKind {
predicate isFunctionPointer() { this = TFunctionPointer() }
predicate isFunctor() { this = TFunctor() }
string toString() {
this.isFunctionPointer() and
result = "Function pointer kind"
or
this.isFunctor() and
result = "Functor kind"
}
}
private class ConstructorCallInstruction extends CallInstruction {
Cpp::Class constructedType;
ConstructorCallInstruction() {
this.getStaticCallTarget().(Cpp::Constructor).getDeclaringType() = constructedType
}
Cpp::Class getConstructedType() { result = constructedType }
}
private class OperatorCall extends Cpp::MemberFunction {
OperatorCall() { this.hasName("operator()") }
}
private predicate isFunctorCreationWithoutConstructor(Node creation, OperatorCall operator) {
exists(UninitializedInstruction init, Instruction dest |
// A construction of an object with no constructor. In this case we use
// the `UninitializedInstruction` as the creation node.
init = creation.asInstruction() and
dest = init.getDestinationAddress() and
not any(ConstructorCallInstruction constructorCall).getThisArgument() = dest and
operator.getDeclaringType() = init.getResultType()
)
or
// Workaround for an extractor bug. In this snippet:
// ```
// struct S { };
// void f(S);
// f(S());
// ```
// The expression `S()` is represented as a 0 literal in the database.
exists(ConstantValueInstruction constant |
constant.getValue() = "0" and
creation.asInstruction() = constant and
constant.getResultType() = operator.getDeclaringType()
)
}
private predicate isFunctorCreationWithConstructor(Node creation, OperatorCall operator) {
exists(DataFlowCall constructorCall, IndirectionPosition pos |
// A construction of an object with a constructor. In this case we use
// the post-update node of the qualifier
pos.getArgumentIndex() = -1 and
isArgumentNode(creation.(PostUpdateNode).getPreUpdateNode(), constructorCall, pos) and
operator.getDeclaringType() =
constructorCall.asCallInstruction().(ConstructorCallInstruction).getConstructedType()
)
}
/** Holds if `creation` is an expression that creates a lambda of kind `kind` for `c`. */
predicate lambdaCreation(Node creation, LambdaCallKind kind, DataFlowCallable c) {
creation.asInstruction().(FunctionAddressInstruction).getFunctionSymbol() = c.asSourceCallable() and
exists(kind)
kind.isFunctionPointer() and
creation.asInstruction().(FunctionAddressInstruction).getFunctionSymbol() = c.asSourceCallable()
or
kind.isFunctor() and
exists(OperatorCall operator | operator = c.asSourceCallable() |
isFunctorCreationWithoutConstructor(creation, operator)
or
isFunctorCreationWithConstructor(creation, operator)
)
}
/** Holds if `call` is a lambda call of kind `kind` where `receiver` is the lambda expression. */
predicate lambdaCall(DataFlowCall call, LambdaCallKind kind, Node receiver) {
kind.isFunctionPointer() and
(
call.(SummaryCall).getReceiver() = receiver.(FlowSummaryNode).getSummaryNode()
or
@@ -1400,8 +1473,15 @@ predicate lambdaCall(DataFlowCall call, LambdaCallKind kind, Node receiver) {
// has a result for `getStaticCallTarget`.
not exists(call.getStaticCallTarget()) and
call.asCallInstruction().getCallTargetOperand() = receiver.asOperand()
) and
exists(kind)
)
or
kind.isFunctor() and
(
call.(SummaryCall).getReceiver() = receiver.(FlowSummaryNode).getSummaryNode()
or
not exists(call.getStaticCallTarget()) and
call.asCallInstruction().getThisArgumentOperand() = receiver.asOperand()
)
}
/** Extra data-flow steps needed for lambda flow analysis. */

View File

@@ -488,6 +488,23 @@ class Node extends TIRDataFlowNode {
result = this.(IndirectParameterNode).getParameter()
}
/**
* Holds if this node represents the `indirectionIndex`'th indirection of
* the value of an output parameter `p` just before reaching the end of a function.
*/
predicate isFinalValueOfParameter(Parameter p, int indirectionIndex) {
exists(FinalParameterNode n | n = this |
p = n.getParameter() and
indirectionIndex = n.getIndirectionIndex()
)
}
/**
* Holds if this node represents the value of an output parameter `p`
* just before reaching the end of a function.
*/
predicate isFinalValueOfParameter(Parameter p) { this.isFinalValueOfParameter(p, _) }
/**
* Gets the variable corresponding to this node, if any. This can be used for
* modeling flow in and out of global variables.
@@ -1225,7 +1242,7 @@ import RawIndirectNodes
/**
* INTERNAL: do not use.
*
* A node representing the value of an update parameter
* A node representing the value of an output parameter
* just before reaching the end of a function.
*/
class FinalParameterNode extends Node, TFinalParameterNode {

View File

@@ -151,7 +151,7 @@ private module Cached {
)
or
// Similarly for `i++` and `++i` we pretend that the generated
// `StoreInstruction` is contains the result of the expression even though
// `StoreInstruction` contains the result of the expression even though
// this isn't totally aligned with the C/C++ standard.
exists(TranslatedCrementOperation tco |
store = tco.getInstruction(CrementStoreTag()) and

View File

@@ -153,6 +153,10 @@ private predicate isGlobalDefImpl(
GlobalLikeVariable v, IRFunction f, int indirection, int indirectionIndex
) {
exists(VariableAddressInstruction vai |
// The right-hand side of an initialization of a global variable
// creates its own `IRFunction`. We don't want flow into that `IRFunction`
// since the variable is only initialized once.
not vai.getEnclosingFunction() = v and
vai.getEnclosingIRFunction() = f and
vai.getAstVariable() = v and
isUse(_, _, vai, indirection, indirectionIndex) and

View File

@@ -42,6 +42,7 @@ private newtype TOpcode =
TCompareGT() or
TCompareLE() or
TCompareGE() or
TSpaceship() or
TPointerAdd() or
TPointerSub() or
TPointerDiff() or
@@ -92,7 +93,9 @@ private newtype TOpcode =
TUninitializedGroup() or
TInlineAsm() or
TUnreached() or
TNewObj()
TNewObj() or
TTypeidExpr() or
TTypeidType()
/**
* An opcode that specifies the operation performed by an `Instruction`.
@@ -763,6 +766,15 @@ module Opcode {
final override string toString() { result = "CompareGE" }
}
/**
* The `Opcode` for a `SpaceshipInstruction`.
*
* See the `SpaceshipInstruction` documentation for more details.
*/
class Spaceship extends BinaryOpcode, TSpaceship {
final override string toString() { result = "Spaceship" }
}
/**
* The `Opcode` for a `PointerAddInstruction`.
*
@@ -1281,4 +1293,29 @@ module Opcode {
class NewObj extends Opcode, TNewObj {
final override string toString() { result = "NewObj" }
}
/**
* The `Opcode` for a `TypeidInstruction`.
*
* See the `TypeidInstruction` documentation for more details.
*/
abstract class Typeid extends Opcode { }
/**
* The `Opcode` for a `TypeidExprInstruction`.
*
* See the `TypeidExprInstruction` documentation for more details.
*/
class TypeidExpr extends Typeid, UnaryOpcode, TTypeidExpr {
final override string toString() { result = "TypeidExpr" }
}
/**
* The `Opcode` for a `TypeidTypeInstruction`.
*
* See the `TypeidTypeInstruction` documentation for more details.
*/
class TypeidType extends Typeid, TTypeidType {
final override string toString() { result = "TypeidType" }
}
}

View File

@@ -725,6 +725,20 @@ class UninitializedInstruction extends VariableInstruction {
* Gets the variable that is uninitialized.
*/
final Language::Variable getLocalVariable() { result = var.(IRUserVariable).getVariable() }
/**
* Gets the operand that provides the address of the location to which the
* uninitialized value will be stored.
*/
final AddressOperand getDestinationAddressOperand() { result = this.getAnOperand() }
/**
* Gets the instruction whose result provides the address of the location to
* which the value will be stored, if an exact definition is available.
*/
final Instruction getDestinationAddress() {
result = this.getDestinationAddressOperand().getDef()
}
}
/**
@@ -1590,6 +1604,13 @@ class CompareGEInstruction extends RelationalInstruction {
override predicate isStrict() { none() }
}
/**
* An instruction that represents a three-way comparison operator.
*/
class SpaceshipInstruction extends BinaryInstruction {
SpaceshipInstruction() { this.getOpcode() instanceof Opcode::Spaceship }
}
/**
* An instruction that branches to one of multiple successor instructions based on the value of an
* integer operand.
@@ -2279,3 +2300,26 @@ class NextVarArgInstruction extends UnaryInstruction {
class NewObjInstruction extends Instruction {
NewObjInstruction() { this.getOpcode() instanceof Opcode::NewObj }
}
/**
* An instruction that returns the type info for its operand.
*/
class TypeidInstruction extends Instruction {
TypeidInstruction() { this.getOpcode() instanceof Opcode::Typeid }
}
/**
* An instruction that returns the type info for its operand, where the
* operand occurs as an expression in the AST.
*/
class TypeidExprInstruction extends TypeidInstruction, UnaryInstruction {
TypeidExprInstruction() { this.getOpcode() instanceof Opcode::TypeidExpr }
}
/**
* An instruction that returns the type info for its operand, where the
* operand occurs as a type in the AST.
*/
class TypeidTypeInstruction extends TypeidInstruction {
TypeidTypeInstruction() { this.getOpcode() instanceof Opcode::TypeidType }
}

View File

@@ -725,6 +725,20 @@ class UninitializedInstruction extends VariableInstruction {
* Gets the variable that is uninitialized.
*/
final Language::Variable getLocalVariable() { result = var.(IRUserVariable).getVariable() }
/**
* Gets the operand that provides the address of the location to which the
* uninitialized value will be stored.
*/
final AddressOperand getDestinationAddressOperand() { result = this.getAnOperand() }
/**
* Gets the instruction whose result provides the address of the location to
* which the value will be stored, if an exact definition is available.
*/
final Instruction getDestinationAddress() {
result = this.getDestinationAddressOperand().getDef()
}
}
/**
@@ -1590,6 +1604,13 @@ class CompareGEInstruction extends RelationalInstruction {
override predicate isStrict() { none() }
}
/**
* An instruction that represents a three-way comparison operator.
*/
class SpaceshipInstruction extends BinaryInstruction {
SpaceshipInstruction() { this.getOpcode() instanceof Opcode::Spaceship }
}
/**
* An instruction that branches to one of multiple successor instructions based on the value of an
* integer operand.
@@ -2279,3 +2300,26 @@ class NextVarArgInstruction extends UnaryInstruction {
class NewObjInstruction extends Instruction {
NewObjInstruction() { this.getOpcode() instanceof Opcode::NewObj }
}
/**
* An instruction that returns the type info for its operand.
*/
class TypeidInstruction extends Instruction {
TypeidInstruction() { this.getOpcode() instanceof Opcode::Typeid }
}
/**
* An instruction that returns the type info for its operand, where the
* operand occurs as an expression in the AST.
*/
class TypeidExprInstruction extends TypeidInstruction, UnaryInstruction {
TypeidExprInstruction() { this.getOpcode() instanceof Opcode::TypeidExpr }
}
/**
* An instruction that returns the type info for its operand, where the
* operand occurs as a type in the AST.
*/
class TypeidTypeInstruction extends TypeidInstruction {
TypeidTypeInstruction() { this.getOpcode() instanceof Opcode::TypeidType }
}

View File

@@ -1808,6 +1808,11 @@ private Opcode comparisonOpcode(ComparisonOperation expr) {
expr instanceof GEExpr and result instanceof Opcode::CompareGE
}
private Opcode spaceShipOpcode(SpaceshipExpr expr) {
exists(expr) and
result instanceof Opcode::Spaceship
}
/**
* IR translation of a simple binary operation.
*/
@@ -1867,7 +1872,8 @@ class TranslatedBinaryOperation extends TranslatedSingleInstructionExpr {
override Opcode getOpcode() {
result = binaryArithmeticOpcode(expr) or
result = binaryBitwiseOpcode(expr) or
result = comparisonOpcode(expr)
result = comparisonOpcode(expr) or
result = spaceShipOpcode(expr)
}
override Type getExprType() {
@@ -4146,7 +4152,8 @@ predicate exprNeedsCopyIfNotLoaded(Expr expr) {
private predicate exprImmediatelyDiscarded(Expr expr) {
exists(ExprStmt s |
s = expr.getParent() and
not exists(StmtExpr se | s = se.getStmt().(BlockStmt).getLastStmt())
not exists(StmtExpr se | s = se.getStmt().(BlockStmt).getLastStmt()) and
not exists(expr.getConversion())
)
or
exists(CommaExpr c | c.getLeftOperand() = expr)
@@ -4184,3 +4191,52 @@ class TranslatedAssumeExpr extends TranslatedSingleInstructionExpr {
none()
}
}
class TranslatedTypeidExpr extends TranslatedSingleInstructionExpr {
override TypeidOperator expr;
final override Opcode getOpcode() {
exists(this.getOperand()) and
result instanceof Opcode::TypeidExpr
or
not exists(this.getOperand()) and
result instanceof Opcode::TypeidType
}
final override Instruction getFirstInstruction(EdgeKind kind) {
result = this.getOperand().getFirstInstruction(kind)
or
not exists(this.getOperand()) and
result = this.getInstruction(OnlyInstructionTag()) and
kind instanceof GotoEdge
}
override Instruction getALastInstructionInternal() {
result = this.getInstruction(OnlyInstructionTag())
}
final override TranslatedElement getChildInternal(int id) {
id = 0 and result = this.getOperand()
}
final override Instruction getInstructionSuccessorInternal(InstructionTag tag, EdgeKind kind) {
tag = OnlyInstructionTag() and
result = this.getParent().getChildSuccessor(this, kind)
}
final override Instruction getChildSuccessorInternal(TranslatedElement child, EdgeKind kind) {
child = this.getOperand() and
result = this.getInstruction(OnlyInstructionTag()) and
kind instanceof GotoEdge
}
final override Instruction getInstructionRegisterOperand(InstructionTag tag, OperandTag operandTag) {
tag = OnlyInstructionTag() and
result = this.getOperand().getResult() and
operandTag instanceof UnaryOperandTag
}
private TranslatedExpr getOperand() {
result = getTranslatedExpr(expr.getExpr().getFullyConverted())
}
}

View File

@@ -725,6 +725,20 @@ class UninitializedInstruction extends VariableInstruction {
* Gets the variable that is uninitialized.
*/
final Language::Variable getLocalVariable() { result = var.(IRUserVariable).getVariable() }
/**
* Gets the operand that provides the address of the location to which the
* uninitialized value will be stored.
*/
final AddressOperand getDestinationAddressOperand() { result = this.getAnOperand() }
/**
* Gets the instruction whose result provides the address of the location to
* which the value will be stored, if an exact definition is available.
*/
final Instruction getDestinationAddress() {
result = this.getDestinationAddressOperand().getDef()
}
}
/**
@@ -1590,6 +1604,13 @@ class CompareGEInstruction extends RelationalInstruction {
override predicate isStrict() { none() }
}
/**
* An instruction that represents a three-way comparison operator.
*/
class SpaceshipInstruction extends BinaryInstruction {
SpaceshipInstruction() { this.getOpcode() instanceof Opcode::Spaceship }
}
/**
* An instruction that branches to one of multiple successor instructions based on the value of an
* integer operand.
@@ -2279,3 +2300,26 @@ class NextVarArgInstruction extends UnaryInstruction {
class NewObjInstruction extends Instruction {
NewObjInstruction() { this.getOpcode() instanceof Opcode::NewObj }
}
/**
* An instruction that returns the type info for its operand.
*/
class TypeidInstruction extends Instruction {
TypeidInstruction() { this.getOpcode() instanceof Opcode::Typeid }
}
/**
* An instruction that returns the type info for its operand, where the
* operand occurs as an expression in the AST.
*/
class TypeidExprInstruction extends TypeidInstruction, UnaryInstruction {
TypeidExprInstruction() { this.getOpcode() instanceof Opcode::TypeidExpr }
}
/**
* An instruction that returns the type info for its operand, where the
* operand occurs as a type in the AST.
*/
class TypeidTypeInstruction extends TypeidInstruction {
TypeidTypeInstruction() { this.getOpcode() instanceof Opcode::TypeidType }
}

View File

@@ -17,7 +17,6 @@
import cpp
import PrintfLike
private import semmle.code.cpp.ir.dataflow.ResolveCall
bindingset[index]
private string toCause(Function func, int index) {
@@ -37,9 +36,9 @@ private predicate wrapperFunctionStep(
not target.isVirtual() and
not source.isVirtual() and
source.hasDefinition() and
exists(Call call, Expr arg, Parameter sourceParam |
exists(FunctionCall call, Expr arg, Parameter sourceParam |
// there is a 'call' to 'target' with argument 'arg' at index 'targetParamIndex'
target = resolveCall(call) and
target = call.getTarget() and
arg = call.getArgument(targetParamIndex) and
// 'call' is enclosed in 'source'
source = call.getEnclosingFunction() and
@@ -154,8 +153,8 @@ abstract class FunctionWithWrappers extends Function {
* Whether 'arg' is an argument in a call to an outermost wrapper function of 'this' function.
*/
predicate outermostWrapperFunctionCall(Expr arg, string callChain) {
exists(Function targetFunc, Call call, int argIndex |
targetFunc = resolveCall(call) and
exists(Function targetFunc, FunctionCall call, int argIndex |
targetFunc = call.getTarget() and
this.wrapperFunction(targetFunc, argIndex, callChain) and
(
exists(Function sourceFunc | sourceFunc = call.getEnclosingFunction() |

View File

@@ -1,8 +1,21 @@
## 1.4.4
### Minor Analysis Improvements
* Due to changes in the `FunctionWithWrappers` library (`semmle.code.cpp.security.FunctionWithWrappers`) the primary alert location generated by the queries `cpp/path-injection`, `cpp/sql-injection`, `cpp/tainted-format-string`, and `cpp/command-line-injection` may have changed.
* Added flow models for the Win32 API functions `CreateThread`, `CreateRemoteThread`, and `CreateRemoteThreadEx`.
* Improved support for dataflow through function objects and lambda expressions.
* Added flow models for `pthread_create` and `std::thread`.
* The `cpp/incorrect-string-type-conversion` query no longer alerts on incorrect type conversions that occur in unreachable code.
* Added flow models for the GNU C Library.
* Fixed a number of false positives and false negatives in `cpp/global-use-before-init`. Note that this query is not part of any of the default query suites.
* The query `cpp/sql-injection` now can be extended using the `sql-injection` Models as Data (MaD) sink kind.
## 1.4.3
### Minor Analysis Improvements
* Added flow model for the following libraries: `madler/zlib`, `google/brotli`, `libidn/libidn2`, `libssh2/libssh2/`, `nghttp2/nghttp2`, `libuv/libuv/`, and `curl/curl`. This may result in more alerts when running queries on codebases that use these libraries.
* Added flow models for the following libraries: `madler/zlib`, `google/brotli`, `libidn/libidn2`, `libssh2/libssh2`, `nghttp2/nghttp2`, `libuv/libuv`, and `curl/curl`. This may result in more alerts when running queries on codebases that use these libraries.
## 1.4.2
@@ -12,7 +25,7 @@ No user-facing changes.
### Minor Analysis Improvements
* Added flow model for the `SQLite` and `OpenSSL` libraries. This may result in more alerts when running queries on codebases that use these libraries.
* Added flow models for the `SQLite` and `OpenSSL` libraries. This may result in more alerts when running queries on codebases that use these libraries.
## 1.4.0

View File

@@ -49,21 +49,16 @@ need to be part of the class. (A classic example of this is the
observes, there are at least two key problems with this approach:
<ul>
<li>
It may be possible to generalize some of the utility functions beyond the
<i>1. It may be possible to generalize some of the utility functions beyond the
narrow context of the class in question -- by bundling them with the class,
the class author reduces the scope for functionality reuse.
</li>
<li>
It's usually impossible for the class author to know every possible
2. It's usually impossible for the class author to know every possible
operation that the user might want to perform on the class, so the public
interface will inherently be incomplete. New utility functions will end up
having a different syntax to the privileged public functions in the class,
negatively impacting on code consistency.
</li>
</ul>
</i>
To refactor a class like this, simply move its utility functions elsewhere,
paring its public interface down to the bare minimum.

View File

@@ -46,21 +46,17 @@ need to be part of the class. (A classic example of this is the
<code>std::string</code> class in the C++ Standard Library.) As [Sutter]
observes, there are at least two key problems with this approach:
<ul>
<li>
It may be possible to generalize some of the utility functions beyond the
<i>
1. It may be possible to generalize some of the utility functions beyond the
narrow context of the class in question -- by bundling them with the class,
the class author reduces the scope for functionality reuse.
</li>
<li>
It's usually impossible for the class author to know every possible
2. It's usually impossible for the class author to know every possible
operation that the user might want to perform on the class, so the public
interface will inherently be incomplete. New utility functions will end up
having a different syntax to the privileged public functions in the class,
negatively impacting on code consistency.
</li>
</ul>
</i>
To refactor a class like this, simply move its utility functions elsewhere,
paring its public interface down to the bare minimum.

View File

@@ -23,7 +23,7 @@ predicate isProcessOperationExplanation(DataFlow::Node arg, string processOperat
exists(int processOperationArg, FunctionCall call |
isProcessOperationArgument(processOperation, processOperationArg) and
call.getTarget().getName() = processOperation and
call.getArgument(processOperationArg) = [arg.asExpr(), arg.asIndirectExpr()]
call.getArgument(processOperationArg) = arg.asIndirectExpr()
)
}

View File

@@ -14,6 +14,7 @@
import cpp
import semmle.code.cpp.controlflow.Guards
import semmle.code.cpp.ir.IR
class WideCharPointerType extends PointerType {
WideCharPointerType() { this.getBaseType() instanceof WideCharType }
@@ -108,7 +109,9 @@ where
// Avoid cases where the cast is guarded by a check to determine if
// unicode encoding is enabled in such a way to disallow the dangerous cast
// at runtime.
not isLikelyDynamicallyChecked(e1)
not isLikelyDynamicallyChecked(e1) and
// Avoid cases in unreachable blocks.
any(EnterFunctionInstruction e).getASuccessor+().getAst() = e1
select e1,
"Conversion from " + e1.getType().toString() + " to " + e2.getType().toString() +
". Use of invalid string can lead to undefined behavior."

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* The query `cpp/sql-injection` now can be extended using the `sql-injection` Models as Data (MaD) sink kind.

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* Fixed a number of false positives and false negatives in `cpp/global-use-before-init`. Note that this query is not part of any of the default query suites.

View File

@@ -2,4 +2,4 @@
### Minor Analysis Improvements
* Added flow model for the `SQLite` and `OpenSSL` libraries. This may result in more alerts when running queries on codebases that use these libraries.
* Added flow models for the `SQLite` and `OpenSSL` libraries. This may result in more alerts when running queries on codebases that use these libraries.

View File

@@ -2,4 +2,4 @@
### Minor Analysis Improvements
* Added flow model for the following libraries: `madler/zlib`, `google/brotli`, `libidn/libidn2`, `libssh2/libssh2/`, `nghttp2/nghttp2`, `libuv/libuv/`, and `curl/curl`. This may result in more alerts when running queries on codebases that use these libraries.
* Added flow models for the following libraries: `madler/zlib`, `google/brotli`, `libidn/libidn2`, `libssh2/libssh2`, `nghttp2/nghttp2`, `libuv/libuv`, and `curl/curl`. This may result in more alerts when running queries on codebases that use these libraries.

View File

@@ -0,0 +1,12 @@
## 1.4.4
### Minor Analysis Improvements
* Due to changes in the `FunctionWithWrappers` library (`semmle.code.cpp.security.FunctionWithWrappers`) the primary alert location generated by the queries `cpp/path-injection`, `cpp/sql-injection`, `cpp/tainted-format-string`, and `cpp/command-line-injection` may have changed.
* Added flow models for the Win32 API functions `CreateThread`, `CreateRemoteThread`, and `CreateRemoteThreadEx`.
* Improved support for dataflow through function objects and lambda expressions.
* Added flow models for `pthread_create` and `std::thread`.
* The `cpp/incorrect-string-type-conversion` query no longer alerts on incorrect type conversions that occur in unreachable code.
* Added flow models for the GNU C Library.
* Fixed a number of false positives and false negatives in `cpp/global-use-before-init`. Note that this query is not part of any of the default query suites.
* The query `cpp/sql-injection` now can be extended using the `sql-injection` Models as Data (MaD) sink kind.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.4.3
lastReleaseVersion: 1.4.4

View File

@@ -1,5 +1,5 @@
name: codeql/cpp-queries
version: 1.4.4-dev
version: 1.4.4
groups:
- cpp
- queries

View File

@@ -37,4 +37,21 @@ void test_aggregate_literal() {
int xs[] = {1, 2, 3}; // $ asExpr=1 asExpr=2 asExpr=3 asExpr={...}
const int ys[] = {[0] = 4, [1] = 5, [0] = 6}; // $ asExpr=4 asExpr=5 asExpr=6 asExpr={...}
}
}
void test_postfix_crement(int *p, int q) {
p++; // $ asExpr="... ++" asIndirectExpr="... ++" asExpr=p asIndirectExpr=p
q++; // $ asExpr="... ++" asExpr=q
(p++); // $ asExpr="... ++" asIndirectExpr="... ++" asExpr="p(... ++)" asIndirectExpr="p(*... ++)"
(q++); // $ asExpr="... ++" asExpr="q(... ++)"
(void)(p++); // $ asExpr="p(... ++)" asIndirectExpr="p(*... ++)"
(void)(q++); // $ asExpr="q(... ++)"
(void)p++; // $ asExpr="p(... ++)" asIndirectExpr="p(*... ++)"
(void)q++; // $ asExpr="q(... ++)"
int *p1 = p++; // $ asExpr="... ++" asIndirectExpr="... ++" asExpr="p(... ++)" asIndirectExpr="p(*... ++)"
int q1 = q++; // $ asExpr="... ++" asExpr="q(... ++)"
(int*)(p++); // $ asExpr="... ++" asIndirectExpr="... ++" asExpr="p(... ++)" asIndirectExpr="p(*... ++)"
(int)(q++); // $ asExpr="... ++" asExpr="q(... ++)"
int *p2 = (int*)(p++); // $ asExpr="... ++" asIndirectExpr="... ++" asExpr="p(... ++)" asIndirectExpr="p(*... ++)"
int q2 = (int)(q++); // $ asExpr="... ++" asExpr="q(... ++)"
}

View File

@@ -6,9 +6,15 @@ uniqueEnclosingCallable
| test.cpp:1126:33:1129:1 | {...} | Node should have one enclosing callable but has 0. |
| test.cpp:1127:3:1127:13 | reads_input | Node should have one enclosing callable but has 0. |
| test.cpp:1128:3:1128:21 | not_does_read_input | Node should have one enclosing callable but has 0. |
| test.cpp:1158:18:1158:21 | call to sink | Node should have one enclosing callable but has 0. |
| test.cpp:1158:18:1158:42 | ... , ... | Node should have one enclosing callable but has 0. |
| test.cpp:1158:23:1158:31 | recursion | Node should have one enclosing callable but has 0. |
| test.cpp:1158:35:1158:40 | call to source | Node should have one enclosing callable but has 0. |
uniqueCallEnclosingCallable
| test.cpp:864:47:864:54 | call to source | Call should have one enclosing callable but has 0. |
| test.cpp:872:46:872:51 | call to source | Call should have one enclosing callable but has 0. |
| test.cpp:1158:18:1158:21 | call to sink | Call should have one enclosing callable but has 0. |
| test.cpp:1158:35:1158:40 | call to source | Call should have one enclosing callable but has 0. |
uniqueType
uniqueNodeLocation
missingLocation

View File

@@ -24,10 +24,9 @@ module AstTest {
module IRTest {
private import semmle.code.cpp.ir.dataflow.DataFlow
private import semmle.code.cpp.ir.dataflow.internal.DataFlowUtil
private string stars(int k) {
k = [0 .. max(FinalParameterNode n | | n.getIndirectionIndex())] and
k = [0 .. max(DataFlow::Node n, int i | n.isFinalValueOfParameter(_, i) | i)] and
(if k = 0 then result = "" else result = "*" + stars(k - 1))
}
@@ -35,14 +34,14 @@ module IRTest {
string getARelevantTag() { result = "ir-def" }
predicate hasActualResult(Location location, string element, string tag, string value) {
exists(Function f, Parameter p, FinalParameterNode n |
exists(Function f, Parameter p, DataFlow::Node n, int i |
p.isNamed() and
n.getParameter() = p and
n.isFinalValueOfParameter(p, i) and
n.getFunction() = f and
location = f.getLocation() and
element = p.toString() and
tag = "ir-def" and
value = stars(n.getIndirectionIndex()) + p.getName()
value = stars(i) + p.getName()
)
}
}

View File

@@ -1153,4 +1153,6 @@ namespace conflation_regression {
*p = source(0);
read_deref_deref(p);
}
}
}
int recursion = (sink(recursion), source()); // clean

View File

@@ -17,13 +17,18 @@ models
| 16 | Source: ; ; false; ymlSource; ; ; ReturnValue; local; manual |
| 17 | Source: boost::asio; ; false; read_until; ; ; Argument[*1]; remote; manual |
| 18 | Summary: ; ; false; CommandLineToArgvA; ; ; Argument[*0]; ReturnValue[**]; taint; manual |
| 19 | Summary: ; ; false; ReadFileEx; ; ; Argument[*3].Field[@hEvent]; Argument[4].Parameter[*2].Field[@hEvent]; value; manual |
| 20 | Summary: ; ; false; ymlStepGenerated; ; ; Argument[0]; ReturnValue; taint; df-generated |
| 21 | Summary: ; ; false; ymlStepManual; ; ; Argument[0]; ReturnValue; taint; manual |
| 22 | Summary: ; ; false; ymlStepManual_with_body; ; ; Argument[0]; ReturnValue; taint; manual |
| 23 | Summary: boost::asio; ; false; buffer; ; ; Argument[*0]; ReturnValue; taint; manual |
| 19 | Summary: ; ; false; CreateRemoteThread; ; ; Argument[@4]; Argument[3].Parameter[@0]; value; manual |
| 20 | Summary: ; ; false; CreateRemoteThreadEx; ; ; Argument[@4]; Argument[3].Parameter[@0]; value; manual |
| 21 | Summary: ; ; false; CreateThread; ; ; Argument[@3]; Argument[2].Parameter[@0]; value; manual |
| 22 | Summary: ; ; false; ReadFileEx; ; ; Argument[*3].Field[@hEvent]; Argument[4].Parameter[*2].Field[@hEvent]; value; manual |
| 23 | Summary: ; ; false; callWithArgument; ; ; Argument[1]; Argument[0].Parameter[0]; value; manual |
| 24 | Summary: ; ; false; pthread_create; ; ; Argument[@3]; Argument[2].Parameter[@0]; value; manual |
| 25 | Summary: ; ; false; ymlStepGenerated; ; ; Argument[0]; ReturnValue; taint; df-generated |
| 26 | Summary: ; ; false; ymlStepManual; ; ; Argument[0]; ReturnValue; taint; manual |
| 27 | Summary: ; ; false; ymlStepManual_with_body; ; ; Argument[0]; ReturnValue; taint; manual |
| 28 | Summary: boost::asio; ; false; buffer; ; ; Argument[*0]; ReturnValue; taint; manual |
edges
| asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | provenance | MaD:23 |
| asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | provenance | MaD:28 |
| asio_streams.cpp:87:34:87:44 | read_until output argument | asio_streams.cpp:91:7:91:17 | recv_buffer | provenance | Src:MaD:17 |
| asio_streams.cpp:87:34:87:44 | read_until output argument | asio_streams.cpp:93:29:93:39 | *recv_buffer | provenance | Src:MaD:17 Sink:MaD:2 |
| asio_streams.cpp:97:37:97:44 | call to source | asio_streams.cpp:98:7:98:14 | send_str | provenance | TaintFunction |
@@ -32,10 +37,10 @@ edges
| asio_streams.cpp:100:44:100:62 | call to buffer | asio_streams.cpp:101:7:101:17 | send_buffer | provenance | |
| asio_streams.cpp:100:44:100:62 | call to buffer | asio_streams.cpp:103:29:103:39 | *send_buffer | provenance | Sink:MaD:2 |
| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | provenance | |
| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:100:44:100:62 | call to buffer | provenance | MaD:23 |
| test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | test.cpp:4:5:4:17 | [summary] to write: ReturnValue in ymlStepManual | provenance | MaD:21 |
| test.cpp:5:5:5:20 | [summary param] 0 in ymlStepGenerated | test.cpp:5:5:5:20 | [summary] to write: ReturnValue in ymlStepGenerated | provenance | MaD:20 |
| test.cpp:6:5:6:27 | [summary param] 0 in ymlStepManual_with_body | test.cpp:6:5:6:27 | [summary] to write: ReturnValue in ymlStepManual_with_body | provenance | MaD:22 |
| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:100:44:100:62 | call to buffer | provenance | MaD:28 |
| test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | test.cpp:4:5:4:17 | [summary] to write: ReturnValue in ymlStepManual | provenance | MaD:26 |
| test.cpp:5:5:5:20 | [summary param] 0 in ymlStepGenerated | test.cpp:5:5:5:20 | [summary] to write: ReturnValue in ymlStepGenerated | provenance | MaD:25 |
| test.cpp:6:5:6:27 | [summary param] 0 in ymlStepManual_with_body | test.cpp:6:5:6:27 | [summary] to write: ReturnValue in ymlStepManual_with_body | provenance | MaD:27 |
| test.cpp:7:47:7:52 | value2 | test.cpp:7:64:7:69 | value2 | provenance | |
| test.cpp:7:64:7:69 | value2 | test.cpp:7:5:7:30 | *ymlStepGenerated_with_body | provenance | |
| test.cpp:10:10:10:18 | call to ymlSource | test.cpp:10:10:10:18 | call to ymlSource | provenance | Src:MaD:16 |
@@ -47,19 +52,49 @@ edges
| test.cpp:17:10:17:22 | call to ymlStepManual | test.cpp:17:10:17:22 | call to ymlStepManual | provenance | |
| test.cpp:17:10:17:22 | call to ymlStepManual | test.cpp:18:10:18:10 | y | provenance | Sink:MaD:1 |
| test.cpp:17:24:17:24 | x | test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | provenance | |
| test.cpp:17:24:17:24 | x | test.cpp:17:10:17:22 | call to ymlStepManual | provenance | MaD:21 |
| test.cpp:17:24:17:24 | x | test.cpp:17:10:17:22 | call to ymlStepManual | provenance | MaD:26 |
| test.cpp:21:10:21:25 | call to ymlStepGenerated | test.cpp:21:10:21:25 | call to ymlStepGenerated | provenance | |
| test.cpp:21:10:21:25 | call to ymlStepGenerated | test.cpp:22:10:22:10 | z | provenance | Sink:MaD:1 |
| test.cpp:21:27:21:27 | x | test.cpp:5:5:5:20 | [summary param] 0 in ymlStepGenerated | provenance | |
| test.cpp:21:27:21:27 | x | test.cpp:21:10:21:25 | call to ymlStepGenerated | provenance | MaD:20 |
| test.cpp:21:27:21:27 | x | test.cpp:21:10:21:25 | call to ymlStepGenerated | provenance | MaD:25 |
| test.cpp:25:11:25:33 | call to ymlStepManual_with_body | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | provenance | |
| test.cpp:25:11:25:33 | call to ymlStepManual_with_body | test.cpp:26:10:26:11 | y2 | provenance | Sink:MaD:1 |
| test.cpp:25:35:25:35 | x | test.cpp:6:5:6:27 | [summary param] 0 in ymlStepManual_with_body | provenance | |
| test.cpp:25:35:25:35 | x | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | provenance | MaD:22 |
| test.cpp:25:35:25:35 | x | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | provenance | MaD:27 |
| test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | provenance | |
| test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | test.cpp:33:10:33:11 | z2 | provenance | Sink:MaD:1 |
| test.cpp:32:41:32:41 | x | test.cpp:7:47:7:52 | value2 | provenance | |
| test.cpp:32:41:32:41 | x | test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | provenance | |
| test.cpp:46:30:46:32 | *arg [x] | test.cpp:47:12:47:19 | *arg [x] | provenance | |
| test.cpp:47:12:47:19 | *arg [x] | test.cpp:48:13:48:13 | *s [x] | provenance | |
| test.cpp:48:13:48:13 | *s [x] | test.cpp:48:16:48:16 | x | provenance | Sink:MaD:1 |
| test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | provenance | MaD:24 |
| test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | test.cpp:46:30:46:32 | *arg [x] | provenance | |
| test.cpp:56:2:56:2 | *s [post update] [x] | test.cpp:59:55:59:64 | *& ... [x] | provenance | |
| test.cpp:56:2:56:18 | ... = ... | test.cpp:56:2:56:2 | *s [post update] [x] | provenance | |
| test.cpp:56:8:56:16 | call to ymlSource | test.cpp:56:2:56:18 | ... = ... | provenance | Src:MaD:16 |
| test.cpp:59:55:59:64 | *& ... [x] | test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | provenance | |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:23 |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:23 |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:23 |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:23 |
| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:68:22:68:22 | y | provenance | |
| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:74:22:74:22 | y | provenance | |
| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:82:22:82:22 | y | provenance | |
| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:88:22:88:22 | y | provenance | |
| test.cpp:68:22:68:22 | y | test.cpp:69:11:69:11 | y | provenance | Sink:MaD:1 |
| test.cpp:74:22:74:22 | y | test.cpp:75:11:75:11 | y | provenance | Sink:MaD:1 |
| test.cpp:82:22:82:22 | y | test.cpp:83:11:83:11 | y | provenance | Sink:MaD:1 |
| test.cpp:88:22:88:22 | y | test.cpp:89:11:89:11 | y | provenance | Sink:MaD:1 |
| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:94:10:94:18 | call to ymlSource | provenance | Src:MaD:16 |
| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:97:26:97:26 | x | provenance | |
| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:101:26:101:26 | x | provenance | |
| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:103:63:103:63 | x | provenance | |
| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:104:62:104:62 | x | provenance | |
| test.cpp:97:26:97:26 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | |
| test.cpp:101:26:101:26 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | |
| test.cpp:103:63:103:63 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | |
| test.cpp:104:62:104:62 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | |
| windows.cpp:17:8:17:25 | [summary param] *0 in CommandLineToArgvA | windows.cpp:17:8:17:25 | [summary] to write: ReturnValue[**] in CommandLineToArgvA | provenance | MaD:18 |
| windows.cpp:22:15:22:29 | *call to GetCommandLineA | windows.cpp:22:15:22:29 | *call to GetCommandLineA | provenance | Src:MaD:3 |
| windows.cpp:22:15:22:29 | *call to GetCommandLineA | windows.cpp:24:8:24:11 | * ... | provenance | |
@@ -73,8 +108,8 @@ edges
| windows.cpp:39:36:39:38 | GetEnvironmentVariableA output argument | windows.cpp:41:10:41:13 | * ... | provenance | Src:MaD:5 |
| windows.cpp:90:6:90:15 | [summary param] *3 in ReadFileEx [*hEvent] | windows.cpp:90:6:90:15 | [summary] read: Argument[*3].Field[*hEvent] in ReadFileEx | provenance | |
| windows.cpp:90:6:90:15 | [summary param] *3 in ReadFileEx [hEvent] | windows.cpp:90:6:90:15 | [summary] read: Argument[*3].Field[hEvent] in ReadFileEx | provenance | |
| windows.cpp:90:6:90:15 | [summary] read: Argument[*3].Field[*hEvent] in ReadFileEx | windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2].Field[*hEvent] in ReadFileEx | provenance | MaD:19 |
| windows.cpp:90:6:90:15 | [summary] read: Argument[*3].Field[hEvent] in ReadFileEx | windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2].Field[hEvent] in ReadFileEx | provenance | MaD:19 |
| windows.cpp:90:6:90:15 | [summary] read: Argument[*3].Field[*hEvent] in ReadFileEx | windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2].Field[*hEvent] in ReadFileEx | provenance | MaD:22 |
| windows.cpp:90:6:90:15 | [summary] read: Argument[*3].Field[hEvent] in ReadFileEx | windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2].Field[hEvent] in ReadFileEx | provenance | MaD:22 |
| windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2] in ReadFileEx [*hEvent] | windows.cpp:147:16:147:27 | *lpOverlapped [*hEvent] | provenance | |
| windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2] in ReadFileEx [hEvent] | windows.cpp:157:16:157:27 | *lpOverlapped [hEvent] | provenance | |
| windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2].Field[*hEvent] in ReadFileEx | windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2] in ReadFileEx [*hEvent] | provenance | |
@@ -122,6 +157,29 @@ edges
| windows.cpp:332:23:332:40 | *call to MapViewOfFileNuma2 | windows.cpp:332:23:332:40 | *call to MapViewOfFileNuma2 | provenance | Src:MaD:12 |
| windows.cpp:332:23:332:40 | *call to MapViewOfFileNuma2 | windows.cpp:333:20:333:52 | *pMapView | provenance | |
| windows.cpp:333:20:333:52 | *pMapView | windows.cpp:335:10:335:16 | * ... | provenance | |
| windows.cpp:349:8:349:19 | [summary param] *3 in CreateThread [x] | windows.cpp:349:8:349:19 | [summary] to write: Argument[2].Parameter[*0] in CreateThread [x] | provenance | MaD:21 |
| windows.cpp:349:8:349:19 | [summary] to write: Argument[2].Parameter[*0] in CreateThread [x] | windows.cpp:403:26:403:36 | *lpParameter [x] | provenance | |
| windows.cpp:357:8:357:25 | [summary param] *4 in CreateRemoteThread [x] | windows.cpp:357:8:357:25 | [summary] to write: Argument[3].Parameter[*0] in CreateRemoteThread [x] | provenance | MaD:19 |
| windows.cpp:357:8:357:25 | [summary] to write: Argument[3].Parameter[*0] in CreateRemoteThread [x] | windows.cpp:410:26:410:36 | *lpParameter [x] | provenance | |
| windows.cpp:387:8:387:27 | [summary param] *4 in CreateRemoteThreadEx [x] | windows.cpp:387:8:387:27 | [summary] to write: Argument[3].Parameter[*0] in CreateRemoteThreadEx [x] | provenance | MaD:20 |
| windows.cpp:387:8:387:27 | [summary] to write: Argument[3].Parameter[*0] in CreateRemoteThreadEx [x] | windows.cpp:417:26:417:36 | *lpParameter [x] | provenance | |
| windows.cpp:403:26:403:36 | *lpParameter [x] | windows.cpp:405:10:405:25 | *lpParameter [x] | provenance | |
| windows.cpp:405:10:405:25 | *lpParameter [x] | windows.cpp:406:8:406:8 | *s [x] | provenance | |
| windows.cpp:406:8:406:8 | *s [x] | windows.cpp:406:8:406:11 | x | provenance | |
| windows.cpp:410:26:410:36 | *lpParameter [x] | windows.cpp:412:10:412:25 | *lpParameter [x] | provenance | |
| windows.cpp:412:10:412:25 | *lpParameter [x] | windows.cpp:413:8:413:8 | *s [x] | provenance | |
| windows.cpp:413:8:413:8 | *s [x] | windows.cpp:413:8:413:11 | x | provenance | |
| windows.cpp:417:26:417:36 | *lpParameter [x] | windows.cpp:419:10:419:25 | *lpParameter [x] | provenance | |
| windows.cpp:419:10:419:25 | *lpParameter [x] | windows.cpp:420:8:420:8 | *s [x] | provenance | |
| windows.cpp:420:8:420:8 | *s [x] | windows.cpp:420:8:420:11 | x | provenance | |
| windows.cpp:431:3:431:3 | *s [post update] [x] | windows.cpp:439:7:439:8 | *& ... [x] | provenance | |
| windows.cpp:431:3:431:3 | *s [post update] [x] | windows.cpp:451:7:451:8 | *& ... [x] | provenance | |
| windows.cpp:431:3:431:3 | *s [post update] [x] | windows.cpp:464:7:464:8 | *& ... [x] | provenance | |
| windows.cpp:431:3:431:16 | ... = ... | windows.cpp:431:3:431:3 | *s [post update] [x] | provenance | |
| windows.cpp:431:9:431:14 | call to source | windows.cpp:431:3:431:16 | ... = ... | provenance | |
| windows.cpp:439:7:439:8 | *& ... [x] | windows.cpp:349:8:349:19 | [summary param] *3 in CreateThread [x] | provenance | |
| windows.cpp:451:7:451:8 | *& ... [x] | windows.cpp:357:8:357:25 | [summary param] *4 in CreateRemoteThread [x] | provenance | |
| windows.cpp:464:7:464:8 | *& ... [x] | windows.cpp:387:8:387:27 | [summary param] *4 in CreateRemoteThreadEx [x] | provenance | |
nodes
| asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | semmle.label | [summary param] *0 in buffer |
| asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | semmle.label | [summary] to write: ReturnValue in buffer |
@@ -163,6 +221,38 @@ nodes
| test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | semmle.label | call to ymlStepGenerated_with_body |
| test.cpp:32:41:32:41 | x | semmle.label | x |
| test.cpp:33:10:33:11 | z2 | semmle.label | z2 |
| test.cpp:46:30:46:32 | *arg [x] | semmle.label | *arg [x] |
| test.cpp:47:12:47:19 | *arg [x] | semmle.label | *arg [x] |
| test.cpp:48:13:48:13 | *s [x] | semmle.label | *s [x] |
| test.cpp:48:16:48:16 | x | semmle.label | x |
| test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | semmle.label | [summary param] *3 in pthread_create [x] |
| test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | semmle.label | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] |
| test.cpp:56:2:56:2 | *s [post update] [x] | semmle.label | *s [post update] [x] |
| test.cpp:56:2:56:18 | ... = ... | semmle.label | ... = ... |
| test.cpp:56:8:56:16 | call to ymlSource | semmle.label | call to ymlSource |
| test.cpp:59:55:59:64 | *& ... [x] | semmle.label | *& ... [x] |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | semmle.label | [summary param] 1 in callWithArgument |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | semmle.label | [summary param] 1 in callWithArgument |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | semmle.label | [summary param] 1 in callWithArgument |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | semmle.label | [summary param] 1 in callWithArgument |
| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | semmle.label | [summary] to write: Argument[0].Parameter[0] in callWithArgument |
| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | semmle.label | [summary] to write: Argument[0].Parameter[0] in callWithArgument |
| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | semmle.label | [summary] to write: Argument[0].Parameter[0] in callWithArgument |
| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | semmle.label | [summary] to write: Argument[0].Parameter[0] in callWithArgument |
| test.cpp:68:22:68:22 | y | semmle.label | y |
| test.cpp:69:11:69:11 | y | semmle.label | y |
| test.cpp:74:22:74:22 | y | semmle.label | y |
| test.cpp:75:11:75:11 | y | semmle.label | y |
| test.cpp:82:22:82:22 | y | semmle.label | y |
| test.cpp:83:11:83:11 | y | semmle.label | y |
| test.cpp:88:22:88:22 | y | semmle.label | y |
| test.cpp:89:11:89:11 | y | semmle.label | y |
| test.cpp:94:10:94:18 | call to ymlSource | semmle.label | call to ymlSource |
| test.cpp:94:10:94:18 | call to ymlSource | semmle.label | call to ymlSource |
| test.cpp:97:26:97:26 | x | semmle.label | x |
| test.cpp:101:26:101:26 | x | semmle.label | x |
| test.cpp:103:63:103:63 | x | semmle.label | x |
| test.cpp:104:62:104:62 | x | semmle.label | x |
| windows.cpp:17:8:17:25 | [summary param] *0 in CommandLineToArgvA | semmle.label | [summary param] *0 in CommandLineToArgvA |
| windows.cpp:17:8:17:25 | [summary] to write: ReturnValue[**] in CommandLineToArgvA | semmle.label | [summary] to write: ReturnValue[**] in CommandLineToArgvA |
| windows.cpp:22:15:22:29 | *call to GetCommandLineA | semmle.label | *call to GetCommandLineA |
@@ -238,6 +328,30 @@ nodes
| windows.cpp:332:23:332:40 | *call to MapViewOfFileNuma2 | semmle.label | *call to MapViewOfFileNuma2 |
| windows.cpp:333:20:333:52 | *pMapView | semmle.label | *pMapView |
| windows.cpp:335:10:335:16 | * ... | semmle.label | * ... |
| windows.cpp:349:8:349:19 | [summary param] *3 in CreateThread [x] | semmle.label | [summary param] *3 in CreateThread [x] |
| windows.cpp:349:8:349:19 | [summary] to write: Argument[2].Parameter[*0] in CreateThread [x] | semmle.label | [summary] to write: Argument[2].Parameter[*0] in CreateThread [x] |
| windows.cpp:357:8:357:25 | [summary param] *4 in CreateRemoteThread [x] | semmle.label | [summary param] *4 in CreateRemoteThread [x] |
| windows.cpp:357:8:357:25 | [summary] to write: Argument[3].Parameter[*0] in CreateRemoteThread [x] | semmle.label | [summary] to write: Argument[3].Parameter[*0] in CreateRemoteThread [x] |
| windows.cpp:387:8:387:27 | [summary param] *4 in CreateRemoteThreadEx [x] | semmle.label | [summary param] *4 in CreateRemoteThreadEx [x] |
| windows.cpp:387:8:387:27 | [summary] to write: Argument[3].Parameter[*0] in CreateRemoteThreadEx [x] | semmle.label | [summary] to write: Argument[3].Parameter[*0] in CreateRemoteThreadEx [x] |
| windows.cpp:403:26:403:36 | *lpParameter [x] | semmle.label | *lpParameter [x] |
| windows.cpp:405:10:405:25 | *lpParameter [x] | semmle.label | *lpParameter [x] |
| windows.cpp:406:8:406:8 | *s [x] | semmle.label | *s [x] |
| windows.cpp:406:8:406:11 | x | semmle.label | x |
| windows.cpp:410:26:410:36 | *lpParameter [x] | semmle.label | *lpParameter [x] |
| windows.cpp:412:10:412:25 | *lpParameter [x] | semmle.label | *lpParameter [x] |
| windows.cpp:413:8:413:8 | *s [x] | semmle.label | *s [x] |
| windows.cpp:413:8:413:11 | x | semmle.label | x |
| windows.cpp:417:26:417:36 | *lpParameter [x] | semmle.label | *lpParameter [x] |
| windows.cpp:419:10:419:25 | *lpParameter [x] | semmle.label | *lpParameter [x] |
| windows.cpp:420:8:420:8 | *s [x] | semmle.label | *s [x] |
| windows.cpp:420:8:420:11 | x | semmle.label | x |
| windows.cpp:431:3:431:3 | *s [post update] [x] | semmle.label | *s [post update] [x] |
| windows.cpp:431:3:431:16 | ... = ... | semmle.label | ... = ... |
| windows.cpp:431:9:431:14 | call to source | semmle.label | call to source |
| windows.cpp:439:7:439:8 | *& ... [x] | semmle.label | *& ... [x] |
| windows.cpp:451:7:451:8 | *& ... [x] | semmle.label | *& ... [x] |
| windows.cpp:464:7:464:8 | *& ... [x] | semmle.label | *& ... [x] |
subpaths
| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | asio_streams.cpp:100:44:100:62 | call to buffer |
| test.cpp:17:24:17:24 | x | test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | test.cpp:4:5:4:17 | [summary] to write: ReturnValue in ymlStepManual | test.cpp:17:10:17:22 | call to ymlStepManual |

View File

@@ -16,4 +16,5 @@ extensions:
- ["", "", False, "ymlStepManual", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["", "", False, "ymlStepGenerated", "", "", "Argument[0]", "ReturnValue", "taint", "df-generated"]
- ["", "", False, "ymlStepManual_with_body", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["", "", False, "ymlStepGenerated_with_body", "", "", "Argument[0]", "ReturnValue", "taint", "df-generated"]
- ["", "", False, "ymlStepGenerated_with_body", "", "", "Argument[0]", "ReturnValue", "taint", "df-generated"]
- ["", "", False, "callWithArgument", "", "", "Argument[1]", "Argument[0].Parameter[0]", "value", "manual"]

View File

@@ -8,3 +8,8 @@
| test.cpp:29:10:29:11 | y3 | test-sink |
| test.cpp:33:10:33:11 | z2 | test-sink |
| test.cpp:36:10:36:11 | z3 | test-sink |
| test.cpp:48:16:48:16 | x | test-sink |
| test.cpp:69:11:69:11 | y | test-sink |
| test.cpp:75:11:75:11 | y | test-sink |
| test.cpp:83:11:83:11 | y | test-sink |
| test.cpp:89:11:89:11 | y | test-sink |

View File

@@ -1,5 +1,7 @@
| asio_streams.cpp:87:34:87:44 | read_until output argument | remote |
| test.cpp:10:10:10:18 | call to ymlSource | local |
| test.cpp:56:8:56:16 | call to ymlSource | local |
| test.cpp:94:10:94:18 | call to ymlSource | local |
| windows.cpp:22:15:22:29 | *call to GetCommandLineA | local |
| windows.cpp:34:17:34:38 | *call to GetEnvironmentStringsA | local |
| windows.cpp:39:36:39:38 | GetEnvironmentVariableA output argument | local |

View File

@@ -35,3 +35,71 @@ void test() {
int z3 = ymlStepGenerated_with_body(x, 0);
ymlSink(z3); // clean
}
struct S {
int x;
};
using pthread_t = unsigned long;
using pthread_attr_t = void*;
void *myThreadFunction(void *arg) {
S* s = (S *)arg;
ymlSink(s->x); // $ ir
return nullptr;
}
int pthread_create(pthread_t *thread, const pthread_attr_t * attr, void *(*start_routine)(void*), void *arg);
int test_pthread_create() {
S s;
s.x = ymlSource();
pthread_t threadId;
pthread_create(&threadId, nullptr, myThreadFunction, (void *)&s);
}
template<typename F>
void callWithArgument(F f, int x);
struct StructWithOperatorCall_has_constructor {
StructWithOperatorCall_has_constructor();
void operator()(int y) {
ymlSink(y); // $ ir
}
};
struct StructWithOperatorCall_no_constructor {
void operator()(int y) {
ymlSink(y); // $ ir
}
};
struct StructWithOperatorCall_has_constructor_2 {
StructWithOperatorCall_has_constructor_2();
void operator()(int y) {
ymlSink(y); // $ ir
}
};
struct StructWithOperatorCall_no_constructor_2 {
void operator()(int y) {
ymlSink(y); // $ ir
}
};
void test_callWithArgument() {
int x = ymlSource();
{
StructWithOperatorCall_has_constructor func;
callWithArgument(func, x);
}
{
StructWithOperatorCall_no_constructor func;
callWithArgument(func, x);
}
callWithArgument(StructWithOperatorCall_has_constructor_2(), x);
callWithArgument(StructWithOperatorCall_no_constructor_2(), x);
}

View File

@@ -335,3 +335,135 @@ void mapViewOfFile(HANDLE hMapFile) {
sink(*buffer); // $ ir
}
}
typedef struct _SECURITY_ATTRIBUTES
{
DWORD nLength;
LPVOID lpSecurityDescriptor;
BOOL bInheritHandle;
} SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
typedef DWORD (*LPTHREAD_START_ROUTINE)(
LPVOID lpThreadParameter);
HANDLE CreateThread(
LPSECURITY_ATTRIBUTES lpThreadAttributes,
SIZE_T dwStackSize,
LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter,
DWORD dwCreationFlags,
LPDWORD lpThreadId);
HANDLE CreateRemoteThread(
HANDLE hProcess,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
SIZE_T dwStackSize,
LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter,
DWORD dwCreationFlags,
LPDWORD lpThreadId
);
typedef ULONG_PTR DWORD_PTR;
typedef struct _PROC_THREAD_ATTRIBUTE_ENTRY
{
DWORD_PTR Attribute;
SIZE_T cbSize;
PVOID lpValue;
} PROC_THREAD_ATTRIBUTE_ENTRY, *LPPROC_THREAD_ATTRIBUTE_ENTRY;
// This structure contains a list of attributes that have been added using UpdateProcThreadAttribute
typedef struct _PROC_THREAD_ATTRIBUTE_LIST
{
DWORD dwFlags;
ULONG Size;
ULONG Count;
ULONG Reserved;
PULONG Unknown;
PROC_THREAD_ATTRIBUTE_ENTRY Entries[1];
} PROC_THREAD_ATTRIBUTE_LIST, *LPPROC_THREAD_ATTRIBUTE_LIST;
HANDLE CreateRemoteThreadEx(
HANDLE hProcess,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
SIZE_T dwStackSize,
LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter,
DWORD dwCreationFlags,
LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
LPDWORD lpThreadId
);
struct S
{
int x;
};
DWORD ThreadProc1(LPVOID lpParameter)
{
S *s = (S *)lpParameter;
sink(s->x); // $ ir
return 0;
}
DWORD ThreadProc2(LPVOID lpParameter)
{
S *s = (S *)lpParameter;
sink(s->x); // $ ir
return 0;
}
DWORD ThreadProc3(LPVOID lpParameter)
{
S *s = (S *)lpParameter;
sink(s->x); // $ ir
return 0;
}
int source();
void test_create_thread()
{
SECURITY_ATTRIBUTES sa;
S s;
s.x = source();
{
DWORD threadId;
HANDLE threadHandle = CreateThread(
&sa,
0,
ThreadProc1,
&s,
0,
&threadId);
}
{
DWORD threadId;
HANDLE threadHandle = CreateRemoteThread(
nullptr,
&sa,
0,
ThreadProc2,
&s,
0,
&threadId);
}
{
DWORD threadId;
PROC_THREAD_ATTRIBUTE_LIST attrList;
HANDLE threadHandle = CreateRemoteThreadEx(
nullptr,
&sa,
0,
ThreadProc3,
&s,
0,
&attrList,
&threadId);
}
}

View File

@@ -7767,6 +7767,34 @@ WARNING: module 'TaintTracking' has been deprecated and may be removed in future
| taint.cpp:830:20:830:34 | call to indirect_source | taint.cpp:832:23:832:24 | in | |
| taint.cpp:831:15:831:17 | out | taint.cpp:832:18:832:20 | out | |
| taint.cpp:831:15:831:17 | out | taint.cpp:833:8:833:10 | out | |
| thread.cpp:10:27:10:27 | s | thread.cpp:10:27:10:27 | s | |
| thread.cpp:10:27:10:27 | s | thread.cpp:11:8:11:8 | s | |
| thread.cpp:14:26:14:26 | s | thread.cpp:15:8:15:8 | s | |
| thread.cpp:18:27:18:27 | s | thread.cpp:18:27:18:27 | s | |
| thread.cpp:18:27:18:27 | s | thread.cpp:19:8:19:8 | s | |
| thread.cpp:18:34:18:34 | y | thread.cpp:20:8:20:8 | y | |
| thread.cpp:24:5:24:5 | s | thread.cpp:25:3:25:3 | s | |
| thread.cpp:24:5:24:5 | s | thread.cpp:26:38:26:38 | s | |
| thread.cpp:24:5:24:5 | s | thread.cpp:27:37:27:37 | s | |
| thread.cpp:24:5:24:5 | s | thread.cpp:28:38:28:38 | s | |
| thread.cpp:24:5:24:5 | s | thread.cpp:32:7:32:7 | s | |
| thread.cpp:25:3:25:3 | s [post update] | thread.cpp:26:38:26:38 | s | |
| thread.cpp:25:3:25:3 | s [post update] | thread.cpp:27:37:27:37 | s | |
| thread.cpp:25:3:25:3 | s [post update] | thread.cpp:28:38:28:38 | s | |
| thread.cpp:25:3:25:3 | s [post update] | thread.cpp:32:7:32:7 | s | |
| thread.cpp:25:3:25:16 | ... = ... | thread.cpp:25:5:25:5 | x [post update] | |
| thread.cpp:25:9:25:14 | call to source | thread.cpp:25:3:25:16 | ... = ... | |
| thread.cpp:26:18:26:39 | call to thread | thread.cpp:33:1:33:1 | t1 | |
| thread.cpp:26:38:26:38 | s | thread.cpp:26:37:26:38 | & ... | |
| thread.cpp:27:18:27:38 | call to thread | thread.cpp:33:1:33:1 | t2 | |
| thread.cpp:27:37:27:37 | ref arg s | thread.cpp:28:38:28:38 | s | |
| thread.cpp:27:37:27:37 | ref arg s | thread.cpp:32:7:32:7 | s | |
| thread.cpp:28:18:28:43 | call to thread | thread.cpp:33:1:33:1 | t3 | |
| thread.cpp:28:38:28:38 | s | thread.cpp:28:37:28:38 | & ... | |
| thread.cpp:30:18:32:8 | call to thread | thread.cpp:33:1:33:1 | t4 | |
| thread.cpp:30:24:30:24 | p | thread.cpp:30:24:30:24 | p | |
| thread.cpp:30:24:30:24 | p | thread.cpp:31:10:31:10 | p | |
| thread.cpp:32:7:32:7 | s | thread.cpp:32:6:32:7 | & ... | |
| vector.cpp:16:43:16:49 | source1 | vector.cpp:17:26:17:32 | source1 | |
| vector.cpp:16:43:16:49 | source1 | vector.cpp:31:38:31:44 | source1 | |
| vector.cpp:17:21:17:33 | call to vector | vector.cpp:19:14:19:14 | v | |

View File

@@ -681,4 +681,17 @@ namespace std {
// the model for `format`.
template <typename... Args>
int same_signature_as_format_but_different_name(format_string, Args &&...args);
}
namespace std {
class thread {
public:
template<class F, class... Args>
explicit thread(F&&, Args&&...);
~thread();
void join();
void detach();
};
}

View File

@@ -0,0 +1,33 @@
#include "stl.h"
int source();
void sink(int);
struct S {
int x;
};
void thread_function_1(S* s) {
sink(s->x); // $ ir
}
void thread_function_2(S s) {
sink(s.x); // $ ir
}
void thread_function_3(S* s, int y) {
sink(s->x); // $ ir
sink(y); // clean
}
void test_thread() {
S s;
s.x = source();
std::thread t1(thread_function_1, &s);
std::thread t2(thread_function_2, s);
std::thread t3(thread_function_3, &s, 42);
std::thread t4([](S* p) {
sink(p->x); // $ ir
}, &s);
}

View File

@@ -24262,6 +24262,281 @@ ir.cpp:
# 2725| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 2725| Type = [PlainCharType] char
# 2725| ValueCategory = prvalue(load)
# 2728| [TopLevelFunction] void test_postfix_crement(int*, int)
# 2728| <params>:
# 2728| getParameter(0): [Parameter] p
# 2728| Type = [IntPointerType] int *
# 2728| getParameter(1): [Parameter] q
# 2728| Type = [IntType] int
# 2728| getEntryPoint(): [BlockStmt] { ... }
# 2729| getStmt(0): [ExprStmt] ExprStmt
# 2729| getExpr(): [PostfixIncrExpr] ... ++
# 2729| Type = [IntPointerType] int *
# 2729| ValueCategory = prvalue
# 2729| getOperand(): [VariableAccess] p
# 2729| Type = [IntPointerType] int *
# 2729| ValueCategory = lvalue
# 2730| getStmt(1): [ExprStmt] ExprStmt
# 2730| getExpr(): [PostfixIncrExpr] ... ++
# 2730| Type = [IntType] int
# 2730| ValueCategory = prvalue
# 2730| getOperand(): [VariableAccess] q
# 2730| Type = [IntType] int
# 2730| ValueCategory = lvalue
# 2731| getStmt(2): [ExprStmt] ExprStmt
# 2731| getExpr(): [PostfixIncrExpr] ... ++
# 2731| Type = [IntPointerType] int *
# 2731| ValueCategory = prvalue
# 2731| getOperand(): [VariableAccess] p
# 2731| Type = [IntPointerType] int *
# 2731| ValueCategory = lvalue
# 2731| getExpr().getFullyConverted(): [ParenthesisExpr] (...)
# 2731| Type = [IntPointerType] int *
# 2731| ValueCategory = prvalue
# 2732| getStmt(3): [ExprStmt] ExprStmt
# 2732| getExpr(): [PostfixIncrExpr] ... ++
# 2732| Type = [IntType] int
# 2732| ValueCategory = prvalue
# 2732| getOperand(): [VariableAccess] q
# 2732| Type = [IntType] int
# 2732| ValueCategory = lvalue
# 2732| getExpr().getFullyConverted(): [ParenthesisExpr] (...)
# 2732| Type = [IntType] int
# 2732| ValueCategory = prvalue
# 2733| getStmt(4): [ExprStmt] ExprStmt
# 2733| getExpr(): [PostfixIncrExpr] ... ++
# 2733| Type = [IntPointerType] int *
# 2733| ValueCategory = prvalue
# 2733| getOperand(): [VariableAccess] p
# 2733| Type = [IntPointerType] int *
# 2733| ValueCategory = lvalue
# 2733| getExpr().getFullyConverted(): [CStyleCast] (void)...
# 2733| Conversion = [VoidConversion] conversion to void
# 2733| Type = [VoidType] void
# 2733| ValueCategory = prvalue
# 2733| getExpr(): [ParenthesisExpr] (...)
# 2733| Type = [IntPointerType] int *
# 2733| ValueCategory = prvalue
# 2734| getStmt(5): [ExprStmt] ExprStmt
# 2734| getExpr(): [PostfixIncrExpr] ... ++
# 2734| Type = [IntType] int
# 2734| ValueCategory = prvalue
# 2734| getOperand(): [VariableAccess] q
# 2734| Type = [IntType] int
# 2734| ValueCategory = lvalue
# 2734| getExpr().getFullyConverted(): [CStyleCast] (void)...
# 2734| Conversion = [VoidConversion] conversion to void
# 2734| Type = [VoidType] void
# 2734| ValueCategory = prvalue
# 2734| getExpr(): [ParenthesisExpr] (...)
# 2734| Type = [IntType] int
# 2734| ValueCategory = prvalue
# 2735| getStmt(6): [ExprStmt] ExprStmt
# 2735| getExpr(): [PostfixIncrExpr] ... ++
# 2735| Type = [IntPointerType] int *
# 2735| ValueCategory = prvalue
# 2735| getOperand(): [VariableAccess] p
# 2735| Type = [IntPointerType] int *
# 2735| ValueCategory = lvalue
# 2735| getExpr().getFullyConverted(): [CStyleCast] (void)...
# 2735| Conversion = [VoidConversion] conversion to void
# 2735| Type = [VoidType] void
# 2735| ValueCategory = prvalue
# 2736| getStmt(7): [ExprStmt] ExprStmt
# 2736| getExpr(): [PostfixIncrExpr] ... ++
# 2736| Type = [IntType] int
# 2736| ValueCategory = prvalue
# 2736| getOperand(): [VariableAccess] q
# 2736| Type = [IntType] int
# 2736| ValueCategory = lvalue
# 2736| getExpr().getFullyConverted(): [CStyleCast] (void)...
# 2736| Conversion = [VoidConversion] conversion to void
# 2736| Type = [VoidType] void
# 2736| ValueCategory = prvalue
# 2737| getStmt(8): [DeclStmt] declaration
# 2737| getDeclarationEntry(0): [VariableDeclarationEntry] definition of p1
# 2737| Type = [IntPointerType] int *
# 2737| getVariable().getInitializer(): [Initializer] initializer for p1
# 2737| getExpr(): [PostfixIncrExpr] ... ++
# 2737| Type = [IntPointerType] int *
# 2737| ValueCategory = prvalue
# 2737| getOperand(): [VariableAccess] p
# 2737| Type = [IntPointerType] int *
# 2737| ValueCategory = lvalue
# 2738| getStmt(9): [DeclStmt] declaration
# 2738| getDeclarationEntry(0): [VariableDeclarationEntry] definition of q1
# 2738| Type = [IntType] int
# 2738| getVariable().getInitializer(): [Initializer] initializer for q1
# 2738| getExpr(): [PostfixIncrExpr] ... ++
# 2738| Type = [IntType] int
# 2738| ValueCategory = prvalue
# 2738| getOperand(): [VariableAccess] q
# 2738| Type = [IntType] int
# 2738| ValueCategory = lvalue
# 2739| getStmt(10): [ExprStmt] ExprStmt
# 2739| getExpr(): [PostfixIncrExpr] ... ++
# 2739| Type = [IntPointerType] int *
# 2739| ValueCategory = prvalue
# 2739| getOperand(): [VariableAccess] p
# 2739| Type = [IntPointerType] int *
# 2739| ValueCategory = lvalue
# 2739| getExpr().getFullyConverted(): [CStyleCast] (int *)...
# 2739| Conversion = [PointerConversion] pointer conversion
# 2739| Type = [IntPointerType] int *
# 2739| ValueCategory = prvalue
# 2739| getExpr(): [ParenthesisExpr] (...)
# 2739| Type = [IntPointerType] int *
# 2739| ValueCategory = prvalue
# 2740| getStmt(11): [ExprStmt] ExprStmt
# 2740| getExpr(): [PostfixIncrExpr] ... ++
# 2740| Type = [IntType] int
# 2740| ValueCategory = prvalue
# 2740| getOperand(): [VariableAccess] q
# 2740| Type = [IntType] int
# 2740| ValueCategory = lvalue
# 2740| getExpr().getFullyConverted(): [CStyleCast] (int)...
# 2740| Conversion = [IntegralConversion] integral conversion
# 2740| Type = [IntType] int
# 2740| ValueCategory = prvalue
# 2740| getExpr(): [ParenthesisExpr] (...)
# 2740| Type = [IntType] int
# 2740| ValueCategory = prvalue
# 2741| getStmt(12): [DeclStmt] declaration
# 2741| getDeclarationEntry(0): [VariableDeclarationEntry] definition of p2
# 2741| Type = [IntPointerType] int *
# 2741| getVariable().getInitializer(): [Initializer] initializer for p2
# 2741| getExpr(): [PostfixIncrExpr] ... ++
# 2741| Type = [IntPointerType] int *
# 2741| ValueCategory = prvalue
# 2741| getOperand(): [VariableAccess] p
# 2741| Type = [IntPointerType] int *
# 2741| ValueCategory = lvalue
# 2741| getExpr().getFullyConverted(): [CStyleCast] (int *)...
# 2741| Conversion = [PointerConversion] pointer conversion
# 2741| Type = [IntPointerType] int *
# 2741| ValueCategory = prvalue
# 2741| getExpr(): [ParenthesisExpr] (...)
# 2741| Type = [IntPointerType] int *
# 2741| ValueCategory = prvalue
# 2742| getStmt(13): [DeclStmt] declaration
# 2742| getDeclarationEntry(0): [VariableDeclarationEntry] definition of q2
# 2742| Type = [IntType] int
# 2742| getVariable().getInitializer(): [Initializer] initializer for q2
# 2742| getExpr(): [PostfixIncrExpr] ... ++
# 2742| Type = [IntType] int
# 2742| ValueCategory = prvalue
# 2742| getOperand(): [VariableAccess] q
# 2742| Type = [IntType] int
# 2742| ValueCategory = lvalue
# 2742| getExpr().getFullyConverted(): [CStyleCast] (int)...
# 2742| Conversion = [IntegralConversion] integral conversion
# 2742| Type = [IntType] int
# 2742| ValueCategory = prvalue
# 2742| getExpr(): [ParenthesisExpr] (...)
# 2742| Type = [IntType] int
# 2742| ValueCategory = prvalue
# 2743| getStmt(14): [ReturnStmt] return ...
# 2747| [CopyAssignmentOperator] std::strong_ordering& std::strong_ordering::operator=(std::strong_ordering const&)
# 2747| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [LValueReferenceType] const strong_ordering &
# 2747| [MoveAssignmentOperator] std::strong_ordering& std::strong_ordering::operator=(std::strong_ordering&&)
# 2747| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [RValueReferenceType] strong_ordering &&
# 2747| [CopyConstructor] void std::strong_ordering::strong_ordering(std::strong_ordering const&)
# 2747| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [LValueReferenceType] const strong_ordering &
# 2747| [MoveConstructor] void std::strong_ordering::strong_ordering(std::strong_ordering&&)
# 2747| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [RValueReferenceType] strong_ordering &&
# 2747| <initializations>:
# 2747| getEntryPoint(): [BlockStmt] { ... }
# 2747| getStmt(0): [ReturnStmt] return ...
# 2748| [Constructor] void std::strong_ordering::strong_ordering(std::_Order)
# 2748| <params>:
# 2748| getParameter(0): [Parameter] v
# 2748| Type = [ScopedEnum] _Order
# 2748| <initializations>:
# 2748| getEntryPoint(): [BlockStmt] { ... }
# 2748| getStmt(0): [ReturnStmt] return ...
# 2763| [CopyAssignmentOperator] ThreeWay& ThreeWay::operator=(ThreeWay const&)
# 2763| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [LValueReferenceType] const ThreeWay &
# 2763| [MoveAssignmentOperator] ThreeWay& ThreeWay::operator=(ThreeWay&&)
# 2763| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [RValueReferenceType] ThreeWay &&
# 2763| [Constructor] void ThreeWay::ThreeWay()
# 2763| <params>:
# 2766| [MemberFunction] std::strong_ordering ThreeWay::operator<=>(ThreeWay&)
# 2766| <params>:
# 2766| getParameter(0): [Parameter] y
# 2766| Type = [LValueReferenceType] ThreeWay &
# 2766| getEntryPoint(): [BlockStmt] { ... }
# 2766| getStmt(0): [ReturnStmt] return ...
# 2766| getExpr(): [SpaceshipExpr] ... <=> ...
# 2766| Type = [Class] strong_ordering
# 2766| ValueCategory = prvalue
# 2766| getChild(0): [PointerFieldAccess] x
# 2766| Type = [IntType] int
# 2766| ValueCategory = prvalue(load)
# 2766| getQualifier(): [ThisExpr] this
# 2766| Type = [PointerType] ThreeWay *
# 2766| ValueCategory = prvalue(load)
# 2766| getChild(1): [ReferenceFieldAccess] x
# 2766| Type = [IntType] int
# 2766| ValueCategory = prvalue(load)
# 2766| getQualifier(): [VariableAccess] y
# 2766| Type = [LValueReferenceType] ThreeWay &
# 2766| ValueCategory = prvalue(load)
# 2766| getQualifier().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 2766| Type = [Class] ThreeWay
# 2766| ValueCategory = lvalue
# 2769| [TopLevelFunction] void test_three_way(int, int, ThreeWay, ThreeWay)
# 2769| <params>:
# 2769| getParameter(0): [Parameter] a
# 2769| Type = [IntType] int
# 2769| getParameter(1): [Parameter] b
# 2769| Type = [IntType] int
# 2769| getParameter(2): [Parameter] c
# 2769| Type = [Class] ThreeWay
# 2769| getParameter(3): [Parameter] d
# 2769| Type = [Class] ThreeWay
# 2769| getEntryPoint(): [BlockStmt] { ... }
# 2770| getStmt(0): [DeclStmt] declaration
# 2770| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x
# 2770| Type = [Class] strong_ordering
# 2770| getVariable().getInitializer(): [Initializer] initializer for x
# 2770| getExpr(): [SpaceshipExpr] ... <=> ...
# 2770| Type = [Class] strong_ordering
# 2770| ValueCategory = prvalue
# 2770| getChild(0): [VariableAccess] a
# 2770| Type = [IntType] int
# 2770| ValueCategory = prvalue(load)
# 2770| getChild(1): [VariableAccess] b
# 2770| Type = [IntType] int
# 2770| ValueCategory = prvalue(load)
# 2771| getStmt(1): [DeclStmt] declaration
# 2771| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y
# 2771| Type = [Class] strong_ordering
# 2771| getVariable().getInitializer(): [Initializer] initializer for y
# 2771| getExpr(): [FunctionCall] call to operator<=>
# 2771| Type = [Class] strong_ordering
# 2771| ValueCategory = prvalue
# 2771| getQualifier(): [VariableAccess] c
# 2771| Type = [Class] ThreeWay
# 2771| ValueCategory = lvalue
# 2771| getArgument(0): [VariableAccess] d
# 2771| Type = [Class] ThreeWay
# 2771| ValueCategory = lvalue
# 2771| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to)
# 2771| Type = [LValueReferenceType] ThreeWay &
# 2771| ValueCategory = prvalue
# 2772| getStmt(2): [ReturnStmt] return ...
ir23.cpp:
# 1| [TopLevelFunction] bool consteval_1()
# 1| <params>:
@@ -50000,3 +50275,42 @@ try_except.cpp:
# 52| Type = [IntType] int
# 52| ValueCategory = prvalue(load)
# 54| getStmt(2): [ReturnStmt] return ...
type_info_test.cpp:
# 3| [TopLevelFunction] void type_info_test(int)
# 3| <params>:
# 3| getParameter(0): [Parameter] x
# 3| Type = [IntType] int
# 3| getEntryPoint(): [BlockStmt] { ... }
# 4| getStmt(0): [DeclStmt] declaration
# 4| getDeclarationEntry(0): [VariableDeclarationEntry] definition of t1
# 4| Type = [LValueReferenceType] const type_info &
# 4| getVariable().getInitializer(): [Initializer] initializer for t1
# 4| getExpr(): [TypeidOperator] typeid ...
# 4| Type = [SpecifiedType] const type_info
# 4| ValueCategory = lvalue
# 4| getExpr(): [VariableAccess] x
# 4| Type = [IntType] int
# 4| ValueCategory = lvalue
# 4| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 4| Type = [LValueReferenceType] const type_info &
# 4| ValueCategory = prvalue
# 5| getStmt(1): [DeclStmt] declaration
# 5| getDeclarationEntry(0): [VariableDeclarationEntry] definition of t2
# 5| Type = [LValueReferenceType] const type_info &
# 5| getVariable().getInitializer(): [Initializer] initializer for t2
# 5| getExpr(): [TypeidOperator] typeid ...
# 5| Type = [SpecifiedType] const type_info
# 5| ValueCategory = lvalue
# 5| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 5| Type = [LValueReferenceType] const type_info &
# 5| ValueCategory = prvalue
# 6| getStmt(2): [ReturnStmt] return ...
typeinfo:
# 4| [CopyAssignmentOperator] std::type_info& std::type_info::operator=(std::type_info const&)
# 4| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [LValueReferenceType] const type_info &
# 4| [MoveAssignmentOperator] std::type_info& std::type_info::operator=(std::type_info&&)
# 4| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [RValueReferenceType] type_info &&

View File

@@ -20156,6 +20156,236 @@ ir.cpp:
# 2724| v2724_12(void) = AliasedUse : ~m2725_8
# 2724| v2724_13(void) = ExitFunction :
# 2728| void test_postfix_crement(int*, int)
# 2728| Block 0
# 2728| v2728_1(void) = EnterFunction :
# 2728| m2728_2(unknown) = AliasedDefinition :
# 2728| m2728_3(unknown) = InitializeNonLocal :
# 2728| m2728_4(unknown) = Chi : total:m2728_2, partial:m2728_3
# 2728| r2728_5(glval<int *>) = VariableAddress[p] :
# 2728| m2728_6(int *) = InitializeParameter[p] : &:r2728_5
# 2728| r2728_7(int *) = Load[p] : &:r2728_5, m2728_6
# 2728| m2728_8(unknown) = InitializeIndirection[p] : &:r2728_7
# 2728| m2728_9(unknown) = Chi : total:m2728_4, partial:m2728_8
# 2728| r2728_10(glval<int>) = VariableAddress[q] :
# 2728| m2728_11(int) = InitializeParameter[q] : &:r2728_10
# 2729| r2729_1(glval<int *>) = VariableAddress[p] :
# 2729| r2729_2(int *) = Load[p] : &:r2729_1, m2728_6
# 2729| r2729_3(int) = Constant[1] :
# 2729| r2729_4(int *) = PointerAdd[4] : r2729_2, r2729_3
# 2729| m2729_5(int *) = Store[p] : &:r2729_1, r2729_4
# 2730| r2730_1(glval<int>) = VariableAddress[q] :
# 2730| r2730_2(int) = Load[q] : &:r2730_1, m2728_11
# 2730| r2730_3(int) = Constant[1] :
# 2730| r2730_4(int) = Add : r2730_2, r2730_3
# 2730| m2730_5(int) = Store[q] : &:r2730_1, r2730_4
# 2731| r2731_1(glval<int *>) = VariableAddress[p] :
# 2731| r2731_2(int *) = Load[p] : &:r2731_1, m2729_5
# 2731| r2731_3(int) = Constant[1] :
# 2731| r2731_4(int *) = PointerAdd[4] : r2731_2, r2731_3
# 2731| m2731_5(int *) = Store[p] : &:r2731_1, r2731_4
# 2731| r2731_6(int *) = CopyValue : r2731_2
# 2732| r2732_1(glval<int>) = VariableAddress[q] :
# 2732| r2732_2(int) = Load[q] : &:r2732_1, m2730_5
# 2732| r2732_3(int) = Constant[1] :
# 2732| r2732_4(int) = Add : r2732_2, r2732_3
# 2732| m2732_5(int) = Store[q] : &:r2732_1, r2732_4
# 2732| r2732_6(int) = CopyValue : r2732_2
# 2733| r2733_1(glval<int *>) = VariableAddress[p] :
# 2733| r2733_2(int *) = Load[p] : &:r2733_1, m2731_5
# 2733| r2733_3(int) = Constant[1] :
# 2733| r2733_4(int *) = PointerAdd[4] : r2733_2, r2733_3
# 2733| m2733_5(int *) = Store[p] : &:r2733_1, r2733_4
# 2733| r2733_6(int *) = CopyValue : r2733_2
# 2733| v2733_7(void) = Convert : r2733_6
# 2734| r2734_1(glval<int>) = VariableAddress[q] :
# 2734| r2734_2(int) = Load[q] : &:r2734_1, m2732_5
# 2734| r2734_3(int) = Constant[1] :
# 2734| r2734_4(int) = Add : r2734_2, r2734_3
# 2734| m2734_5(int) = Store[q] : &:r2734_1, r2734_4
# 2734| r2734_6(int) = CopyValue : r2734_2
# 2734| v2734_7(void) = Convert : r2734_6
# 2735| r2735_1(glval<int *>) = VariableAddress[p] :
# 2735| r2735_2(int *) = Load[p] : &:r2735_1, m2733_5
# 2735| r2735_3(int) = Constant[1] :
# 2735| r2735_4(int *) = PointerAdd[4] : r2735_2, r2735_3
# 2735| m2735_5(int *) = Store[p] : &:r2735_1, r2735_4
# 2735| r2735_6(int *) = CopyValue : r2735_2
# 2735| v2735_7(void) = Convert : r2735_6
# 2736| r2736_1(glval<int>) = VariableAddress[q] :
# 2736| r2736_2(int) = Load[q] : &:r2736_1, m2734_5
# 2736| r2736_3(int) = Constant[1] :
# 2736| r2736_4(int) = Add : r2736_2, r2736_3
# 2736| m2736_5(int) = Store[q] : &:r2736_1, r2736_4
# 2736| r2736_6(int) = CopyValue : r2736_2
# 2736| v2736_7(void) = Convert : r2736_6
# 2737| r2737_1(glval<int *>) = VariableAddress[p1] :
# 2737| r2737_2(glval<int *>) = VariableAddress[p] :
# 2737| r2737_3(int *) = Load[p] : &:r2737_2, m2735_5
# 2737| r2737_4(int) = Constant[1] :
# 2737| r2737_5(int *) = PointerAdd[4] : r2737_3, r2737_4
# 2737| m2737_6(int *) = Store[p] : &:r2737_2, r2737_5
# 2737| r2737_7(int *) = CopyValue : r2737_3
# 2737| m2737_8(int *) = Store[p1] : &:r2737_1, r2737_7
# 2738| r2738_1(glval<int>) = VariableAddress[q1] :
# 2738| r2738_2(glval<int>) = VariableAddress[q] :
# 2738| r2738_3(int) = Load[q] : &:r2738_2, m2736_5
# 2738| r2738_4(int) = Constant[1] :
# 2738| r2738_5(int) = Add : r2738_3, r2738_4
# 2738| m2738_6(int) = Store[q] : &:r2738_2, r2738_5
# 2738| r2738_7(int) = CopyValue : r2738_3
# 2738| m2738_8(int) = Store[q1] : &:r2738_1, r2738_7
# 2739| r2739_1(glval<int *>) = VariableAddress[p] :
# 2739| r2739_2(int *) = Load[p] : &:r2739_1, m2737_6
# 2739| r2739_3(int) = Constant[1] :
# 2739| r2739_4(int *) = PointerAdd[4] : r2739_2, r2739_3
# 2739| m2739_5(int *) = Store[p] : &:r2739_1, r2739_4
# 2739| r2739_6(int *) = CopyValue : r2739_2
# 2739| r2739_7(int *) = Convert : r2739_6
# 2740| r2740_1(glval<int>) = VariableAddress[q] :
# 2740| r2740_2(int) = Load[q] : &:r2740_1, m2738_6
# 2740| r2740_3(int) = Constant[1] :
# 2740| r2740_4(int) = Add : r2740_2, r2740_3
# 2740| m2740_5(int) = Store[q] : &:r2740_1, r2740_4
# 2740| r2740_6(int) = CopyValue : r2740_2
# 2740| r2740_7(int) = Convert : r2740_6
# 2741| r2741_1(glval<int *>) = VariableAddress[p2] :
# 2741| r2741_2(glval<int *>) = VariableAddress[p] :
# 2741| r2741_3(int *) = Load[p] : &:r2741_2, m2739_5
# 2741| r2741_4(int) = Constant[1] :
# 2741| r2741_5(int *) = PointerAdd[4] : r2741_3, r2741_4
# 2741| m2741_6(int *) = Store[p] : &:r2741_2, r2741_5
# 2741| r2741_7(int *) = CopyValue : r2741_3
# 2741| r2741_8(int *) = Convert : r2741_7
# 2741| m2741_9(int *) = Store[p2] : &:r2741_1, r2741_8
# 2742| r2742_1(glval<int>) = VariableAddress[q2] :
# 2742| r2742_2(glval<int>) = VariableAddress[q] :
# 2742| r2742_3(int) = Load[q] : &:r2742_2, m2740_5
# 2742| r2742_4(int) = Constant[1] :
# 2742| r2742_5(int) = Add : r2742_3, r2742_4
# 2742| m2742_6(int) = Store[q] : &:r2742_2, r2742_5
# 2742| r2742_7(int) = CopyValue : r2742_3
# 2742| r2742_8(int) = Convert : r2742_7
# 2742| m2742_9(int) = Store[q2] : &:r2742_1, r2742_8
# 2743| v2743_1(void) = NoOp :
# 2728| v2728_12(void) = ReturnIndirection[p] : &:r2728_7, m2728_8
# 2728| v2728_13(void) = ReturnVoid :
# 2728| v2728_14(void) = AliasedUse : ~m2728_9
# 2728| v2728_15(void) = ExitFunction :
# 2747| void std::strong_ordering::strong_ordering(std::strong_ordering&&)
# 2747| Block 0
# 2747| v2747_1(void) = EnterFunction :
# 2747| m2747_2(unknown) = AliasedDefinition :
# 2747| m2747_3(unknown) = InitializeNonLocal :
# 2747| m2747_4(unknown) = Chi : total:m2747_2, partial:m2747_3
# 2747| r2747_5(glval<unknown>) = VariableAddress[#this] :
# 2747| m2747_6(glval<strong_ordering>) = InitializeParameter[#this] : &:r2747_5
# 2747| r2747_7(glval<strong_ordering>) = Load[#this] : &:r2747_5, m2747_6
# 2747| m2747_8(strong_ordering) = InitializeIndirection[#this] : &:r2747_7
#-----| r0_1(glval<strong_ordering &&>) = VariableAddress[(unnamed parameter 0)] :
#-----| m0_2(strong_ordering &&) = InitializeParameter[(unnamed parameter 0)] : &:r0_1
#-----| r0_3(strong_ordering &&) = Load[(unnamed parameter 0)] : &:r0_1, m0_2
#-----| m0_4(unknown) = InitializeIndirection[(unnamed parameter 0)] : &:r0_3
# 2747| v2747_9(void) = NoOp :
# 2747| v2747_10(void) = ReturnIndirection[#this] : &:r2747_7, m2747_8
#-----| v0_5(void) = ReturnIndirection[(unnamed parameter 0)] : &:r0_3, m0_4
# 2747| v2747_11(void) = ReturnVoid :
# 2747| v2747_12(void) = AliasedUse : m2747_3
# 2747| v2747_13(void) = ExitFunction :
# 2748| void std::strong_ordering::strong_ordering(std::_Order)
# 2748| Block 0
# 2748| v2748_1(void) = EnterFunction :
# 2748| m2748_2(unknown) = AliasedDefinition :
# 2748| m2748_3(unknown) = InitializeNonLocal :
# 2748| m2748_4(unknown) = Chi : total:m2748_2, partial:m2748_3
# 2748| r2748_5(glval<unknown>) = VariableAddress[#this] :
# 2748| m2748_6(glval<strong_ordering>) = InitializeParameter[#this] : &:r2748_5
# 2748| r2748_7(glval<strong_ordering>) = Load[#this] : &:r2748_5, m2748_6
# 2748| m2748_8(strong_ordering) = InitializeIndirection[#this] : &:r2748_7
# 2748| r2748_9(glval<_Order>) = VariableAddress[v] :
# 2748| m2748_10(_Order) = InitializeParameter[v] : &:r2748_9
# 2748| v2748_11(void) = NoOp :
# 2748| v2748_12(void) = ReturnIndirection[#this] : &:r2748_7, m2748_8
# 2748| v2748_13(void) = ReturnVoid :
# 2748| v2748_14(void) = AliasedUse : m2748_3
# 2748| v2748_15(void) = ExitFunction :
# 2766| std::strong_ordering ThreeWay::operator<=>(ThreeWay&)
# 2766| Block 0
# 2766| v2766_1(void) = EnterFunction :
# 2766| m2766_2(unknown) = AliasedDefinition :
# 2766| m2766_3(unknown) = InitializeNonLocal :
# 2766| m2766_4(unknown) = Chi : total:m2766_2, partial:m2766_3
# 2766| r2766_5(glval<unknown>) = VariableAddress[#this] :
# 2766| m2766_6(glval<ThreeWay>) = InitializeParameter[#this] : &:r2766_5
# 2766| r2766_7(glval<ThreeWay>) = Load[#this] : &:r2766_5, m2766_6
# 2766| m2766_8(ThreeWay) = InitializeIndirection[#this] : &:r2766_7
# 2766| r2766_9(glval<ThreeWay &>) = VariableAddress[y] :
# 2766| m2766_10(ThreeWay &) = InitializeParameter[y] : &:r2766_9
# 2766| r2766_11(ThreeWay &) = Load[y] : &:r2766_9, m2766_10
# 2766| m2766_12(unknown) = InitializeIndirection[y] : &:r2766_11
# 2766| r2766_13(glval<strong_ordering>) = VariableAddress[#return] :
# 2766| r2766_14(glval<unknown>) = VariableAddress[#this] :
# 2766| r2766_15(ThreeWay *) = Load[#this] : &:r2766_14, m2766_6
# 2766| r2766_16(glval<int>) = FieldAddress[x] : r2766_15
# 2766| r2766_17(int) = Load[?] : &:r2766_16, ~m2766_8
# 2766| r2766_18(glval<ThreeWay &>) = VariableAddress[y] :
# 2766| r2766_19(ThreeWay &) = Load[y] : &:r2766_18, m2766_10
# 2766| r2766_20(glval<ThreeWay>) = CopyValue : r2766_19
# 2766| r2766_21(glval<int>) = FieldAddress[x] : r2766_20
# 2766| r2766_22(int) = Load[?] : &:r2766_21, ~m2766_12
# 2766| r2766_23(strong_ordering) = Spaceship : r2766_17, r2766_22
# 2766| m2766_24(strong_ordering) = Store[#return] : &:r2766_13, r2766_23
# 2766| v2766_25(void) = ReturnIndirection[#this] : &:r2766_7, m2766_8
# 2766| v2766_26(void) = ReturnIndirection[y] : &:r2766_11, m2766_12
# 2766| r2766_27(glval<strong_ordering>) = VariableAddress[#return] :
# 2766| v2766_28(void) = ReturnValue : &:r2766_27, m2766_24
# 2766| v2766_29(void) = AliasedUse : m2766_3
# 2766| v2766_30(void) = ExitFunction :
# 2769| void test_three_way(int, int, ThreeWay, ThreeWay)
# 2769| Block 0
# 2769| v2769_1(void) = EnterFunction :
# 2769| m2769_2(unknown) = AliasedDefinition :
# 2769| m2769_3(unknown) = InitializeNonLocal :
# 2769| m2769_4(unknown) = Chi : total:m2769_2, partial:m2769_3
# 2769| r2769_5(glval<int>) = VariableAddress[a] :
# 2769| m2769_6(int) = InitializeParameter[a] : &:r2769_5
# 2769| r2769_7(glval<int>) = VariableAddress[b] :
# 2769| m2769_8(int) = InitializeParameter[b] : &:r2769_7
# 2769| r2769_9(glval<ThreeWay>) = VariableAddress[c] :
# 2769| m2769_10(ThreeWay) = InitializeParameter[c] : &:r2769_9
# 2769| r2769_11(glval<ThreeWay>) = VariableAddress[d] :
# 2769| m2769_12(ThreeWay) = InitializeParameter[d] : &:r2769_11
# 2770| r2770_1(glval<strong_ordering>) = VariableAddress[x] :
# 2770| r2770_2(glval<int>) = VariableAddress[a] :
# 2770| r2770_3(int) = Load[a] : &:r2770_2, m2769_6
# 2770| r2770_4(glval<int>) = VariableAddress[b] :
# 2770| r2770_5(int) = Load[b] : &:r2770_4, m2769_8
# 2770| r2770_6(strong_ordering) = Spaceship : r2770_3, r2770_5
# 2770| m2770_7(strong_ordering) = Store[x] : &:r2770_1, r2770_6
# 2771| r2771_1(glval<strong_ordering>) = VariableAddress[y] :
# 2771| r2771_2(glval<ThreeWay>) = VariableAddress[c] :
# 2771| r2771_3(glval<unknown>) = FunctionAddress[operator<=>] :
# 2771| r2771_4(glval<ThreeWay>) = VariableAddress[d] :
# 2771| r2771_5(ThreeWay &) = CopyValue : r2771_4
# 2771| r2771_6(strong_ordering) = Call[operator<=>] : func:r2771_3, this:r2771_2, 0:r2771_5
# 2771| m2771_7(unknown) = ^CallSideEffect : ~m2769_4
# 2771| m2771_8(unknown) = Chi : total:m2769_4, partial:m2771_7
# 2771| v2771_9(void) = ^IndirectReadSideEffect[-1] : &:r2771_2, m2769_10
# 2771| v2771_10(void) = ^BufferReadSideEffect[0] : &:r2771_5, ~m2769_12
# 2771| m2771_11(ThreeWay) = ^IndirectMayWriteSideEffect[-1] : &:r2771_2
# 2771| m2771_12(ThreeWay) = Chi : total:m2769_10, partial:m2771_11
# 2771| m2771_13(unknown) = ^BufferMayWriteSideEffect[0] : &:r2771_5
# 2771| m2771_14(ThreeWay) = Chi : total:m2769_12, partial:m2771_13
# 2771| m2771_15(strong_ordering) = Store[y] : &:r2771_1, r2771_6
# 2772| v2772_1(void) = NoOp :
# 2769| v2769_13(void) = ReturnVoid :
# 2769| v2769_14(void) = AliasedUse : ~m2771_8
# 2769| v2769_15(void) = ExitFunction :
ir23.cpp:
# 1| bool consteval_1()
# 1| Block 0
@@ -39856,3 +40086,27 @@ try_except.cpp:
# 44| Block 7
# 44| v44_10(void) = Unreached :
type_info_test.cpp:
# 3| void type_info_test(int)
# 3| Block 0
# 3| v3_1(void) = EnterFunction :
# 3| m3_2(unknown) = AliasedDefinition :
# 3| m3_3(unknown) = InitializeNonLocal :
# 3| m3_4(unknown) = Chi : total:m3_2, partial:m3_3
# 3| r3_5(glval<int>) = VariableAddress[x] :
# 3| m3_6(int) = InitializeParameter[x] : &:r3_5
# 3| m3_7(unknown) = Chi : total:m3_4, partial:m3_6
# 4| r4_1(glval<type_info &>) = VariableAddress[t1] :
# 4| r4_2(glval<int>) = VariableAddress[x] :
# 4| r4_3(glval<type_info>) = TypeidExpr : r4_2
# 4| r4_4(type_info &) = CopyValue : r4_3
# 4| m4_5(type_info &) = Store[t1] : &:r4_1, r4_4
# 5| r5_1(glval<type_info &>) = VariableAddress[t2] :
# 5| r5_2(glval<type_info>) = TypeidType :
# 5| r5_3(type_info &) = CopyValue : r5_2
# 5| m5_4(type_info &) = Store[t2] : &:r5_1, r5_3
# 6| v6_1(void) = NoOp :
# 3| v3_8(void) = ReturnVoid :
# 3| v3_9(void) = AliasedUse : m3_3
# 3| v3_10(void) = ExitFunction :

View File

@@ -2725,4 +2725,50 @@ char UseBracketOperator(const WithBracketOperator x, int i) {
return x[i];
}
void test_postfix_crement(int *p, int q) {
p++;
q++;
(p++);
(q++);
(void)(p++);
(void)(q++);
(void)p++;
(void)q++;
int *p1 = p++;
int q1 = q++;
(int*)(p++);
(int)(q++);
int *p2 = (int*)(p++);
int q2 = (int)(q++);
}
namespace std {
enum class _Order : signed char { __less = -1, __equiv = 0, __greater = 1 };
class strong_ordering {
explicit constexpr strong_ordering(_Order v) {}
public:
static const strong_ordering less;
static const strong_ordering equal;
static const strong_ordering equivalent;
static const strong_ordering greater;
};
inline constexpr strong_ordering strong_ordering::less(_Order::__less);
inline constexpr strong_ordering strong_ordering::equal(_Order::__equiv);
inline constexpr strong_ordering strong_ordering::equivalent(_Order::__equiv);
inline constexpr strong_ordering strong_ordering::greater(_Order::__greater);
}
class ThreeWay {
int x;
public:
std::strong_ordering operator<=>(ThreeWay &y) { return this->x <=> y.x; }
};
void test_three_way(int a, int b, ThreeWay c, ThreeWay d) {
auto x = a <=> b;
auto y = c <=> d;
}
// semmle-extractor-options: -std=c++20 --clang

View File

@@ -18317,6 +18317,227 @@ ir.cpp:
# 2724| v2724_10(void) = AliasedUse : ~m?
# 2724| v2724_11(void) = ExitFunction :
# 2728| void test_postfix_crement(int*, int)
# 2728| Block 0
# 2728| v2728_1(void) = EnterFunction :
# 2728| mu2728_2(unknown) = AliasedDefinition :
# 2728| mu2728_3(unknown) = InitializeNonLocal :
# 2728| r2728_4(glval<int *>) = VariableAddress[p] :
# 2728| mu2728_5(int *) = InitializeParameter[p] : &:r2728_4
# 2728| r2728_6(int *) = Load[p] : &:r2728_4, ~m?
# 2728| mu2728_7(unknown) = InitializeIndirection[p] : &:r2728_6
# 2728| r2728_8(glval<int>) = VariableAddress[q] :
# 2728| mu2728_9(int) = InitializeParameter[q] : &:r2728_8
# 2729| r2729_1(glval<int *>) = VariableAddress[p] :
# 2729| r2729_2(int *) = Load[p] : &:r2729_1, ~m?
# 2729| r2729_3(int) = Constant[1] :
# 2729| r2729_4(int *) = PointerAdd[4] : r2729_2, r2729_3
# 2729| mu2729_5(int *) = Store[p] : &:r2729_1, r2729_4
# 2730| r2730_1(glval<int>) = VariableAddress[q] :
# 2730| r2730_2(int) = Load[q] : &:r2730_1, ~m?
# 2730| r2730_3(int) = Constant[1] :
# 2730| r2730_4(int) = Add : r2730_2, r2730_3
# 2730| mu2730_5(int) = Store[q] : &:r2730_1, r2730_4
# 2731| r2731_1(glval<int *>) = VariableAddress[p] :
# 2731| r2731_2(int *) = Load[p] : &:r2731_1, ~m?
# 2731| r2731_3(int) = Constant[1] :
# 2731| r2731_4(int *) = PointerAdd[4] : r2731_2, r2731_3
# 2731| mu2731_5(int *) = Store[p] : &:r2731_1, r2731_4
# 2731| r2731_6(int *) = CopyValue : r2731_2
# 2732| r2732_1(glval<int>) = VariableAddress[q] :
# 2732| r2732_2(int) = Load[q] : &:r2732_1, ~m?
# 2732| r2732_3(int) = Constant[1] :
# 2732| r2732_4(int) = Add : r2732_2, r2732_3
# 2732| mu2732_5(int) = Store[q] : &:r2732_1, r2732_4
# 2732| r2732_6(int) = CopyValue : r2732_2
# 2733| r2733_1(glval<int *>) = VariableAddress[p] :
# 2733| r2733_2(int *) = Load[p] : &:r2733_1, ~m?
# 2733| r2733_3(int) = Constant[1] :
# 2733| r2733_4(int *) = PointerAdd[4] : r2733_2, r2733_3
# 2733| mu2733_5(int *) = Store[p] : &:r2733_1, r2733_4
# 2733| r2733_6(int *) = CopyValue : r2733_2
# 2733| v2733_7(void) = Convert : r2733_6
# 2734| r2734_1(glval<int>) = VariableAddress[q] :
# 2734| r2734_2(int) = Load[q] : &:r2734_1, ~m?
# 2734| r2734_3(int) = Constant[1] :
# 2734| r2734_4(int) = Add : r2734_2, r2734_3
# 2734| mu2734_5(int) = Store[q] : &:r2734_1, r2734_4
# 2734| r2734_6(int) = CopyValue : r2734_2
# 2734| v2734_7(void) = Convert : r2734_6
# 2735| r2735_1(glval<int *>) = VariableAddress[p] :
# 2735| r2735_2(int *) = Load[p] : &:r2735_1, ~m?
# 2735| r2735_3(int) = Constant[1] :
# 2735| r2735_4(int *) = PointerAdd[4] : r2735_2, r2735_3
# 2735| mu2735_5(int *) = Store[p] : &:r2735_1, r2735_4
# 2735| r2735_6(int *) = CopyValue : r2735_2
# 2735| v2735_7(void) = Convert : r2735_6
# 2736| r2736_1(glval<int>) = VariableAddress[q] :
# 2736| r2736_2(int) = Load[q] : &:r2736_1, ~m?
# 2736| r2736_3(int) = Constant[1] :
# 2736| r2736_4(int) = Add : r2736_2, r2736_3
# 2736| mu2736_5(int) = Store[q] : &:r2736_1, r2736_4
# 2736| r2736_6(int) = CopyValue : r2736_2
# 2736| v2736_7(void) = Convert : r2736_6
# 2737| r2737_1(glval<int *>) = VariableAddress[p1] :
# 2737| r2737_2(glval<int *>) = VariableAddress[p] :
# 2737| r2737_3(int *) = Load[p] : &:r2737_2, ~m?
# 2737| r2737_4(int) = Constant[1] :
# 2737| r2737_5(int *) = PointerAdd[4] : r2737_3, r2737_4
# 2737| mu2737_6(int *) = Store[p] : &:r2737_2, r2737_5
# 2737| r2737_7(int *) = CopyValue : r2737_3
# 2737| mu2737_8(int *) = Store[p1] : &:r2737_1, r2737_7
# 2738| r2738_1(glval<int>) = VariableAddress[q1] :
# 2738| r2738_2(glval<int>) = VariableAddress[q] :
# 2738| r2738_3(int) = Load[q] : &:r2738_2, ~m?
# 2738| r2738_4(int) = Constant[1] :
# 2738| r2738_5(int) = Add : r2738_3, r2738_4
# 2738| mu2738_6(int) = Store[q] : &:r2738_2, r2738_5
# 2738| r2738_7(int) = CopyValue : r2738_3
# 2738| mu2738_8(int) = Store[q1] : &:r2738_1, r2738_7
# 2739| r2739_1(glval<int *>) = VariableAddress[p] :
# 2739| r2739_2(int *) = Load[p] : &:r2739_1, ~m?
# 2739| r2739_3(int) = Constant[1] :
# 2739| r2739_4(int *) = PointerAdd[4] : r2739_2, r2739_3
# 2739| mu2739_5(int *) = Store[p] : &:r2739_1, r2739_4
# 2739| r2739_6(int *) = CopyValue : r2739_2
# 2739| r2739_7(int *) = Convert : r2739_6
# 2740| r2740_1(glval<int>) = VariableAddress[q] :
# 2740| r2740_2(int) = Load[q] : &:r2740_1, ~m?
# 2740| r2740_3(int) = Constant[1] :
# 2740| r2740_4(int) = Add : r2740_2, r2740_3
# 2740| mu2740_5(int) = Store[q] : &:r2740_1, r2740_4
# 2740| r2740_6(int) = CopyValue : r2740_2
# 2740| r2740_7(int) = Convert : r2740_6
# 2741| r2741_1(glval<int *>) = VariableAddress[p2] :
# 2741| r2741_2(glval<int *>) = VariableAddress[p] :
# 2741| r2741_3(int *) = Load[p] : &:r2741_2, ~m?
# 2741| r2741_4(int) = Constant[1] :
# 2741| r2741_5(int *) = PointerAdd[4] : r2741_3, r2741_4
# 2741| mu2741_6(int *) = Store[p] : &:r2741_2, r2741_5
# 2741| r2741_7(int *) = CopyValue : r2741_3
# 2741| r2741_8(int *) = Convert : r2741_7
# 2741| mu2741_9(int *) = Store[p2] : &:r2741_1, r2741_8
# 2742| r2742_1(glval<int>) = VariableAddress[q2] :
# 2742| r2742_2(glval<int>) = VariableAddress[q] :
# 2742| r2742_3(int) = Load[q] : &:r2742_2, ~m?
# 2742| r2742_4(int) = Constant[1] :
# 2742| r2742_5(int) = Add : r2742_3, r2742_4
# 2742| mu2742_6(int) = Store[q] : &:r2742_2, r2742_5
# 2742| r2742_7(int) = CopyValue : r2742_3
# 2742| r2742_8(int) = Convert : r2742_7
# 2742| mu2742_9(int) = Store[q2] : &:r2742_1, r2742_8
# 2743| v2743_1(void) = NoOp :
# 2728| v2728_10(void) = ReturnIndirection[p] : &:r2728_6, ~m?
# 2728| v2728_11(void) = ReturnVoid :
# 2728| v2728_12(void) = AliasedUse : ~m?
# 2728| v2728_13(void) = ExitFunction :
# 2747| void std::strong_ordering::strong_ordering(std::strong_ordering&&)
# 2747| Block 0
# 2747| v2747_1(void) = EnterFunction :
# 2747| mu2747_2(unknown) = AliasedDefinition :
# 2747| mu2747_3(unknown) = InitializeNonLocal :
# 2747| r2747_4(glval<unknown>) = VariableAddress[#this] :
# 2747| mu2747_5(glval<strong_ordering>) = InitializeParameter[#this] : &:r2747_4
# 2747| r2747_6(glval<strong_ordering>) = Load[#this] : &:r2747_4, ~m?
# 2747| mu2747_7(strong_ordering) = InitializeIndirection[#this] : &:r2747_6
#-----| r0_1(glval<strong_ordering &&>) = VariableAddress[(unnamed parameter 0)] :
#-----| mu0_2(strong_ordering &&) = InitializeParameter[(unnamed parameter 0)] : &:r0_1
#-----| r0_3(strong_ordering &&) = Load[(unnamed parameter 0)] : &:r0_1, ~m?
#-----| mu0_4(unknown) = InitializeIndirection[(unnamed parameter 0)] : &:r0_3
# 2747| v2747_8(void) = NoOp :
# 2747| v2747_9(void) = ReturnIndirection[#this] : &:r2747_6, ~m?
#-----| v0_5(void) = ReturnIndirection[(unnamed parameter 0)] : &:r0_3, ~m?
# 2747| v2747_10(void) = ReturnVoid :
# 2747| v2747_11(void) = AliasedUse : ~m?
# 2747| v2747_12(void) = ExitFunction :
# 2748| void std::strong_ordering::strong_ordering(std::_Order)
# 2748| Block 0
# 2748| v2748_1(void) = EnterFunction :
# 2748| mu2748_2(unknown) = AliasedDefinition :
# 2748| mu2748_3(unknown) = InitializeNonLocal :
# 2748| r2748_4(glval<unknown>) = VariableAddress[#this] :
# 2748| mu2748_5(glval<strong_ordering>) = InitializeParameter[#this] : &:r2748_4
# 2748| r2748_6(glval<strong_ordering>) = Load[#this] : &:r2748_4, ~m?
# 2748| mu2748_7(strong_ordering) = InitializeIndirection[#this] : &:r2748_6
# 2748| r2748_8(glval<_Order>) = VariableAddress[v] :
# 2748| mu2748_9(_Order) = InitializeParameter[v] : &:r2748_8
# 2748| v2748_10(void) = NoOp :
# 2748| v2748_11(void) = ReturnIndirection[#this] : &:r2748_6, ~m?
# 2748| v2748_12(void) = ReturnVoid :
# 2748| v2748_13(void) = AliasedUse : ~m?
# 2748| v2748_14(void) = ExitFunction :
# 2766| std::strong_ordering ThreeWay::operator<=>(ThreeWay&)
# 2766| Block 0
# 2766| v2766_1(void) = EnterFunction :
# 2766| mu2766_2(unknown) = AliasedDefinition :
# 2766| mu2766_3(unknown) = InitializeNonLocal :
# 2766| r2766_4(glval<unknown>) = VariableAddress[#this] :
# 2766| mu2766_5(glval<ThreeWay>) = InitializeParameter[#this] : &:r2766_4
# 2766| r2766_6(glval<ThreeWay>) = Load[#this] : &:r2766_4, ~m?
# 2766| mu2766_7(ThreeWay) = InitializeIndirection[#this] : &:r2766_6
# 2766| r2766_8(glval<ThreeWay &>) = VariableAddress[y] :
# 2766| mu2766_9(ThreeWay &) = InitializeParameter[y] : &:r2766_8
# 2766| r2766_10(ThreeWay &) = Load[y] : &:r2766_8, ~m?
# 2766| mu2766_11(unknown) = InitializeIndirection[y] : &:r2766_10
# 2766| r2766_12(glval<strong_ordering>) = VariableAddress[#return] :
# 2766| r2766_13(glval<unknown>) = VariableAddress[#this] :
# 2766| r2766_14(ThreeWay *) = Load[#this] : &:r2766_13, ~m?
# 2766| r2766_15(glval<int>) = FieldAddress[x] : r2766_14
# 2766| r2766_16(int) = Load[?] : &:r2766_15, ~m?
# 2766| r2766_17(glval<ThreeWay &>) = VariableAddress[y] :
# 2766| r2766_18(ThreeWay &) = Load[y] : &:r2766_17, ~m?
# 2766| r2766_19(glval<ThreeWay>) = CopyValue : r2766_18
# 2766| r2766_20(glval<int>) = FieldAddress[x] : r2766_19
# 2766| r2766_21(int) = Load[?] : &:r2766_20, ~m?
# 2766| r2766_22(strong_ordering) = Spaceship : r2766_16, r2766_21
# 2766| mu2766_23(strong_ordering) = Store[#return] : &:r2766_12, r2766_22
# 2766| v2766_24(void) = ReturnIndirection[#this] : &:r2766_6, ~m?
# 2766| v2766_25(void) = ReturnIndirection[y] : &:r2766_10, ~m?
# 2766| r2766_26(glval<strong_ordering>) = VariableAddress[#return] :
# 2766| v2766_27(void) = ReturnValue : &:r2766_26, ~m?
# 2766| v2766_28(void) = AliasedUse : ~m?
# 2766| v2766_29(void) = ExitFunction :
# 2769| void test_three_way(int, int, ThreeWay, ThreeWay)
# 2769| Block 0
# 2769| v2769_1(void) = EnterFunction :
# 2769| mu2769_2(unknown) = AliasedDefinition :
# 2769| mu2769_3(unknown) = InitializeNonLocal :
# 2769| r2769_4(glval<int>) = VariableAddress[a] :
# 2769| mu2769_5(int) = InitializeParameter[a] : &:r2769_4
# 2769| r2769_6(glval<int>) = VariableAddress[b] :
# 2769| mu2769_7(int) = InitializeParameter[b] : &:r2769_6
# 2769| r2769_8(glval<ThreeWay>) = VariableAddress[c] :
# 2769| mu2769_9(ThreeWay) = InitializeParameter[c] : &:r2769_8
# 2769| r2769_10(glval<ThreeWay>) = VariableAddress[d] :
# 2769| mu2769_11(ThreeWay) = InitializeParameter[d] : &:r2769_10
# 2770| r2770_1(glval<strong_ordering>) = VariableAddress[x] :
# 2770| r2770_2(glval<int>) = VariableAddress[a] :
# 2770| r2770_3(int) = Load[a] : &:r2770_2, ~m?
# 2770| r2770_4(glval<int>) = VariableAddress[b] :
# 2770| r2770_5(int) = Load[b] : &:r2770_4, ~m?
# 2770| r2770_6(strong_ordering) = Spaceship : r2770_3, r2770_5
# 2770| mu2770_7(strong_ordering) = Store[x] : &:r2770_1, r2770_6
# 2771| r2771_1(glval<strong_ordering>) = VariableAddress[y] :
# 2771| r2771_2(glval<ThreeWay>) = VariableAddress[c] :
# 2771| r2771_3(glval<unknown>) = FunctionAddress[operator<=>] :
# 2771| r2771_4(glval<ThreeWay>) = VariableAddress[d] :
# 2771| r2771_5(ThreeWay &) = CopyValue : r2771_4
# 2771| r2771_6(strong_ordering) = Call[operator<=>] : func:r2771_3, this:r2771_2, 0:r2771_5
# 2771| mu2771_7(unknown) = ^CallSideEffect : ~m?
# 2771| v2771_8(void) = ^IndirectReadSideEffect[-1] : &:r2771_2, ~m?
# 2771| v2771_9(void) = ^BufferReadSideEffect[0] : &:r2771_5, ~m?
# 2771| mu2771_10(ThreeWay) = ^IndirectMayWriteSideEffect[-1] : &:r2771_2
# 2771| mu2771_11(unknown) = ^BufferMayWriteSideEffect[0] : &:r2771_5
# 2771| mu2771_12(strong_ordering) = Store[y] : &:r2771_1, r2771_6
# 2772| v2772_1(void) = NoOp :
# 2769| v2769_12(void) = ReturnVoid :
# 2769| v2769_13(void) = AliasedUse : ~m?
# 2769| v2769_14(void) = ExitFunction :
ir23.cpp:
# 1| bool consteval_1()
# 1| Block 0
@@ -37987,3 +38208,25 @@ try_except.cpp:
# 54| v54_1(void) = NoOp :
# 44| v44_9(void) = ReturnVoid :
#-----| Goto -> Block 1
type_info_test.cpp:
# 3| void type_info_test(int)
# 3| Block 0
# 3| v3_1(void) = EnterFunction :
# 3| mu3_2(unknown) = AliasedDefinition :
# 3| mu3_3(unknown) = InitializeNonLocal :
# 3| r3_4(glval<int>) = VariableAddress[x] :
# 3| mu3_5(int) = InitializeParameter[x] : &:r3_4
# 4| r4_1(glval<type_info &>) = VariableAddress[t1] :
# 4| r4_2(glval<int>) = VariableAddress[x] :
# 4| r4_3(glval<type_info>) = TypeidExpr : r4_2
# 4| r4_4(type_info &) = CopyValue : r4_3
# 4| mu4_5(type_info &) = Store[t1] : &:r4_1, r4_4
# 5| r5_1(glval<type_info &>) = VariableAddress[t2] :
# 5| r5_2(glval<type_info>) = TypeidType :
# 5| r5_3(type_info &) = CopyValue : r5_2
# 5| mu5_4(type_info &) = Store[t2] : &:r5_1, r5_3
# 6| v6_1(void) = NoOp :
# 3| v3_6(void) = ReturnVoid :
# 3| v3_7(void) = AliasedUse : ~m?
# 3| v3_8(void) = ExitFunction :

View File

@@ -0,0 +1,8 @@
#include <typeinfo>
void type_info_test(int x) {
const std::type_info &t1 = typeid(x);
const std::type_info &t2 = typeid(int);
}
// semmle-extractor-options: -I.

View File

@@ -0,0 +1,5 @@
#pragma once
namespace std{
class type_info {};
}

View File

@@ -1,9 +1,6 @@
edges
| consts.cpp:24:7:24:9 | **gv1 | consts.cpp:25:2:25:4 | *a | provenance | |
| consts.cpp:24:7:24:9 | **gv1 | consts.cpp:30:9:30:14 | *access to array | provenance | |
| consts.cpp:24:7:24:9 | **gv1 | consts.cpp:123:2:123:12 | *... = ... | provenance | |
| consts.cpp:25:2:25:4 | *a | consts.cpp:26:2:26:4 | *{...} | provenance | |
| consts.cpp:26:2:26:4 | *{...} | consts.cpp:24:7:24:9 | **gv1 | provenance | |
| consts.cpp:29:7:29:25 | **nonConstFuncToArray | consts.cpp:126:9:126:30 | *call to nonConstFuncToArray | provenance | |
| consts.cpp:30:9:30:14 | *access to array | consts.cpp:29:7:29:25 | **nonConstFuncToArray | provenance | |
| consts.cpp:85:7:85:8 | gets output argument | consts.cpp:86:9:86:10 | *v1 | provenance | |
@@ -38,8 +35,6 @@ edges
| consts.cpp:144:16:144:18 | readStringRef output argument | consts.cpp:145:9:145:11 | *v12 | provenance | |
nodes
| consts.cpp:24:7:24:9 | **gv1 | semmle.label | **gv1 |
| consts.cpp:25:2:25:4 | *a | semmle.label | *a |
| consts.cpp:26:2:26:4 | *{...} | semmle.label | *{...} |
| consts.cpp:29:7:29:25 | **nonConstFuncToArray | semmle.label | **nonConstFuncToArray |
| consts.cpp:30:9:30:14 | *access to array | semmle.label | *access to array |
| consts.cpp:85:7:85:8 | gets output argument | semmle.label | gets output argument |

View File

@@ -18,13 +18,13 @@ void Test()
wchar_t *lpWchar = NULL;
LPCSTR lpcstr = "b";
lpWchar = (LPWSTR)"a"; // BUG
lpWchar = (LPWSTR)lpcstr; // BUG
lpWchar = (LPWSTR)"a"; // $ Alert
lpWchar = (LPWSTR)lpcstr; // $ Alert
lpWchar = (wchar_t*)lpChar; // BUG
lpWchar = (wchar_t*)lpChar; // $ Alert
fconstWChar((LPCWSTR)lpChar); // BUG
fWChar((LPWSTR)lpChar); // BUG
fconstWChar((LPCWSTR)lpChar); // $ Alert
fWChar((LPWSTR)lpChar); // $ Alert
lpChar = (LPSTR)"a"; // Valid
lpWchar = (LPWSTR)L"a"; // Valid
@@ -79,33 +79,64 @@ void CheckedConversionFalsePositiveTest3(unsigned short flags, LPTSTR buffer)
if(flags & UNICODE)
lpWchar = (LPWSTR)buffer; // GOOD
else
lpWchar = (LPWSTR)buffer; // BUG
lpWchar = (LPWSTR)buffer; // $ Alert
if((flags & UNICODE) == 0x8)
lpWchar = (LPWSTR)buffer; // GOOD
else
lpWchar = (LPWSTR)buffer; // BUG
lpWchar = (LPWSTR)buffer; // $ Alert
if((flags & UNICODE) != 0x8)
lpWchar = (LPWSTR)buffer; // BUG
lpWchar = (LPWSTR)buffer; // $ Alert
else
lpWchar = (LPWSTR)buffer; // GOOD
// Bad operator precedence
if(flags & UNICODE == 0x8)
lpWchar = (LPWSTR)buffer; // BUG
lpWchar = (LPWSTR)buffer; // $ Alert
else
lpWchar = (LPWSTR)buffer; // BUG
lpWchar = (LPWSTR)buffer; // $ Alert
if((flags & UNICODE) != 0)
lpWchar = (LPWSTR)buffer; // GOOD
else
lpWchar = (LPWSTR)buffer; // BUG
lpWchar = (LPWSTR)buffer; // $ Alert
if((flags & UNICODE) == 0)
lpWchar = (LPWSTR)buffer; // BUG
lpWchar = (LPWSTR)buffer; // $ Alert
else
lpWchar = (LPWSTR)buffer; // GOOD
lpWchar = (LPWSTR)buffer; // BUG
lpWchar = (LPWSTR)buffer; // $ Alert
}
typedef unsigned long long size_t;
size_t wcslen(const wchar_t *str);
size_t strlen(const char* str);
template<typename C>
size_t str_len(const C *str) {
if (sizeof(C) != 1) {
return wcslen((const wchar_t *)str); // GOOD -- unreachable code
}
return strlen((const char *)str);
}
template<typename C>
size_t wrong_str_len(const C *str) {
if (sizeof(C) == 1) {
return wcslen((const wchar_t *)str); // $ Alert
}
return strlen((const char *)str);
}
void test_str_len(const wchar_t *wstr, const char *str) {
size_t len =
str_len(wstr) +
str_len(str) +
wrong_str_len(wstr) +
wrong_str_len(str);
}

View File

@@ -11,3 +11,4 @@
| WcharCharConversion.cpp:103:21:103:26 | buffer | Conversion from LPTSTR to LPWSTR. Use of invalid string can lead to undefined behavior. |
| WcharCharConversion.cpp:106:21:106:26 | buffer | Conversion from LPTSTR to LPWSTR. Use of invalid string can lead to undefined behavior. |
| WcharCharConversion.cpp:110:20:110:25 | buffer | Conversion from LPTSTR to LPWSTR. Use of invalid string can lead to undefined behavior. |
| WcharCharConversion.cpp:130:34:130:36 | str | Conversion from const char * to const wchar_t *. Use of invalid string can lead to undefined behavior. |

View File

@@ -1 +1,2 @@
Security/CWE/CWE-704/WcharCharConversion.ql
query: Security/CWE/CWE-704/WcharCharConversion.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -43,5 +43,5 @@ MySql.Data.MySqlClient,48,,,,,,,,,,,,48,,,,,,,,,,
Newtonsoft.Json,,,91,,,,,,,,,,,,,,,,,,,73,18
ServiceStack,194,,7,27,,,,,75,,,,92,,,,,,,,,7,
SourceGenerators,,,5,,,,,,,,,,,,,,,,,,,,5
System,54,47,12139,,6,5,5,,,4,1,,33,2,,6,15,17,4,3,,5903,6236
System,54,47,12165,,6,5,5,,,4,1,,33,2,,6,15,17,4,3,,5929,6236
Windows.Security.Cryptography.Core,1,,,,,,,1,,,,,,,,,,,,,,,
1 package sink source summary sink:code-injection sink:encryption-decryptor sink:encryption-encryptor sink:encryption-keyprop sink:encryption-symmetrickey sink:file-content-store sink:html-injection sink:js-injection sink:log-injection sink:sql-injection source:commandargs source:database source:environment source:file source:file-write source:remote source:stdin source:windows-registry summary:taint summary:value
43 Newtonsoft.Json 91 73 18
44 ServiceStack 194 7 27 75 92 7
45 SourceGenerators 5 5
46 System 54 47 12139 12165 6 5 5 4 1 33 2 6 15 17 4 3 5903 5929 6236
47 Windows.Security.Cryptography.Core 1 1

View File

@@ -8,7 +8,7 @@ C# framework & library support
Framework / library,Package,Flow sources,Taint & value steps,Sinks (total),`CWE-079` :sub:`Cross-site scripting`
`ServiceStack <https://servicestack.net/>`_,"``ServiceStack.*``, ``ServiceStack``",,7,194,
System,"``System.*``, ``System``",47,12139,54,5
System,"``System.*``, ``System``",47,12165,54,5
Others,"``Amazon.Lambda.APIGatewayEvents``, ``Amazon.Lambda.Core``, ``Dapper``, ``ILCompiler``, ``ILLink.RoslynAnalyzer``, ``ILLink.Shared``, ``ILLink.Tasks``, ``Internal.IL``, ``Internal.Pgo``, ``Internal.TypeSystem``, ``Microsoft.ApplicationBlocks.Data``, ``Microsoft.AspNetCore.Components``, ``Microsoft.AspNetCore.Http``, ``Microsoft.AspNetCore.Mvc``, ``Microsoft.AspNetCore.WebUtilities``, ``Microsoft.CSharp``, ``Microsoft.Data.SqlClient``, ``Microsoft.Diagnostics.Tools.Pgo``, ``Microsoft.DotNet.Build.Tasks``, ``Microsoft.DotNet.PlatformAbstractions``, ``Microsoft.EntityFrameworkCore``, ``Microsoft.Extensions.Caching.Distributed``, ``Microsoft.Extensions.Caching.Memory``, ``Microsoft.Extensions.Configuration``, ``Microsoft.Extensions.DependencyInjection``, ``Microsoft.Extensions.DependencyModel``, ``Microsoft.Extensions.Diagnostics.Metrics``, ``Microsoft.Extensions.FileProviders``, ``Microsoft.Extensions.FileSystemGlobbing``, ``Microsoft.Extensions.Hosting``, ``Microsoft.Extensions.Http``, ``Microsoft.Extensions.Logging``, ``Microsoft.Extensions.Options``, ``Microsoft.Extensions.Primitives``, ``Microsoft.Interop``, ``Microsoft.JSInterop``, ``Microsoft.NET.Build.Tasks``, ``Microsoft.VisualBasic``, ``Microsoft.Win32``, ``Mono.Linker``, ``MySql.Data.MySqlClient``, ``Newtonsoft.Json``, ``SourceGenerators``, ``Windows.Security.Cryptography.Core``",60,2257,159,4
Totals,,107,14403,407,9
Totals,,107,14429,407,9

View File

@@ -1,3 +1,7 @@
## 1.7.44
No user-facing changes.
## 1.7.43
No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 1.7.44
No user-facing changes.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.7.43
lastReleaseVersion: 1.7.44

View File

@@ -1,5 +1,5 @@
name: codeql/csharp-solorigate-all
version: 1.7.44-dev
version: 1.7.44
groups:
- csharp
- solorigate

View File

@@ -1,3 +1,7 @@
## 1.7.44
No user-facing changes.
## 1.7.43
No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 1.7.44
No user-facing changes.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.7.43
lastReleaseVersion: 1.7.44

View File

@@ -1,5 +1,5 @@
name: codeql/csharp-solorigate-queries
version: 1.7.44-dev
version: 1.7.44
groups:
- csharp
- solorigate

View File

@@ -1,3 +1,9 @@
## 5.2.0
### New Features
* Added a new predicate, `getASuperType()`, to get a direct supertype of this type.
## 5.1.9
No user-facing changes.

View File

@@ -0,0 +1,5 @@
## 5.2.0
### New Features
* Added a new predicate, `getASuperType()`, to get a direct supertype of this type.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 5.1.9
lastReleaseVersion: 5.2.0

View File

@@ -47,7 +47,7 @@ extensions:
- ["System.IO", "FileStream", False, "FileStream", "(System.String,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,System.Int32)", "", "Argument[0]", "Argument[this]", "taint", "manual"]
- ["System.IO", "FileStream", False, "FileStream", "(System.String,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,System.Int32,System.Boolean)", "", "Argument[0]", "Argument[this]", "taint", "manual"]
- ["System.IO", "FileStream", False, "FileStream", "(System.String,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,System.Int32,System.IO.FileOptions)", "", "Argument[0]", "Argument[this]", "taint", "manual"]
- ["System.IO", "MemoryStream", False, "MemoryStream", "(System.Byte[])", "", "Argument[0]", "Argument[this]", "taint", "manual"]
- ["System.IO", "MemoryStream", False, "MemoryStream", "(System.Byte[])", "", "Argument[0].Element", "Argument[this]", "taint", "manual"]
- ["System.IO", "MemoryStream", False, "MemoryStream", "(System.Byte[],System.Boolean)", "", "Argument[0].Element", "Argument[this]", "taint", "manual"]
- ["System.IO", "MemoryStream", False, "MemoryStream", "(System.Byte[],System.Int32,System.Int32)", "", "Argument[0].Element", "Argument[this]", "taint", "manual"]
- ["System.IO", "MemoryStream", False, "MemoryStream", "(System.Byte[],System.Int32,System.Int32,System.Boolean)", "", "Argument[0].Element", "Argument[this]", "taint", "manual"]

View File

@@ -0,0 +1,13 @@
extensions:
- addsTo:
pack: codeql/csharp-all
extensible: summaryModel
data:
- ["System.Runtime.Serialization", "SerializationInfo", False, "AddValue", "(System.String,System.Object)", "", "Argument[1]", "Argument[this]", "taint", "manual"]
- ["System.Runtime.Serialization", "SerializationInfo", False, "AddValue", "(System.String,System.Object,System.Type)", "", "Argument[1]", "Argument[this]", "taint", "manual"]
- ["System.Runtime.Serialization", "SerializationInfo", False, "GetEnumerator", "()", "", "Argument[this]", "ReturnValue", "taint", "manual"]
- ["System.Runtime.Serialization", "SerializationInfo", False, "GetString", "(System.String)", "", "Argument[this]", "ReturnValue", "taint", "manual"]
- ["System.Runtime.Serialization", "SerializationInfo", False, "GetValue", "(System.String,System.Type)", "", "Argument[this]", "ReturnValue", "taint", "manual"]
# Note that SerializationEntry hasn't been modeled yet, so the model below for get_Current will not in itself provide more flow.
- ["System.Runtime.Serialization", "SerializationInfoEnumerator", False, "get_Current", "()", "", "Argument[this]", "ReturnValue", "taint", "manual"]
- ["System.Runtime.Serialization", "SerializationInfoEnumerator", False, "get_Value", "()", "", "Argument[this]", "ReturnValue", "taint", "manual"]

View File

@@ -3,18 +3,18 @@ extensions:
pack: codeql/csharp-all
extensible: summaryModel
data:
- ["System.Text", "Encoding", True, "GetBytes", "(System.Char*,System.Int32,System.Byte*,System.Int32)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetBytes", "(System.Char*,System.Int32,System.Byte*,System.Int32)", "", "Argument[0].Element", "Argument[2]", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetBytes", "(System.Char[])", "", "Argument[0].Element", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetBytes", "(System.Char[],System.Int32,System.Int32)", "", "Argument[0].Element", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetBytes", "(System.Char[],System.Int32,System.Int32,System.Byte[],System.Int32)", "", "Argument[0].Element", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetBytes", "(System.ReadOnlySpan<System.Char>,System.Span<System.Byte>)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetBytes", "(System.Char[],System.Int32,System.Int32,System.Byte[],System.Int32)", "", "Argument[0].Element", "Argument[3]", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetBytes", "(System.ReadOnlySpan<System.Char>,System.Span<System.Byte>)", "", "Argument[0].Element", "Argument[1]", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetBytes", "(System.String)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", False, "GetBytes", "(System.String,System.Int32,System.Int32)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetBytes", "(System.String,System.Int32,System.Int32,System.Byte[],System.Int32)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetChars", "(System.Byte*,System.Int32,System.Char*,System.Int32)", "", "Argument[0].Element", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetBytes", "(System.String,System.Int32,System.Int32)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetBytes", "(System.String,System.Int32,System.Int32,System.Byte[],System.Int32)", "", "Argument[0]", "Argument[3]", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetChars", "(System.Byte*,System.Int32,System.Char*,System.Int32)", "", "Argument[0].Element", "Argument[2]", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetChars", "(System.Byte[])", "", "Argument[0].Element", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetChars", "(System.Byte[],System.Int32,System.Int32)", "", "Argument[0].Element", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetChars", "(System.Byte[],System.Int32,System.Int32,System.Char[],System.Int32)", "", "Argument[0].Element", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetChars", "(System.Byte[],System.Int32,System.Int32,System.Char[],System.Int32)", "", "Argument[0].Element", "Argument[3]", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetChars", "(System.ReadOnlySpan<System.Byte>,System.Span<System.Char>)", "", "Argument[0].Element", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", False, "GetString", "(System.Byte*,System.Int32)", "", "Argument[0].Element", "ReturnValue", "taint", "manual"]
- ["System.Text", "Encoding", True, "GetString", "(System.Byte[])", "", "Argument[0].Element", "ReturnValue", "taint", "manual"]

Some files were not shown because too many files have changed in this diff Show More