Compare commits

..

454 Commits

Author SHA1 Message Date
Chris Smowton
78fcbd07d6 Merge pull request #14630 from github/release-prep/2.15.2
Release preparation for version 2.15.2
2023-10-30 11:26:32 +00:00
github-actions[bot]
4641990021 Release preparation for version 2.15.2 2023-10-30 11:05:53 +00:00
Mathias Vorreiter Pedersen
c4521a30aa Merge pull request #14113 from geoffw0/implicitflow
Swift: Flow through OpenExistentialExpr
2023-10-30 10:08:29 +00:00
Mathias Vorreiter Pedersen
4e08ba6820 Merge pull request #14618 from geoffw0/qldoc
Swift: QLDoc and test for getCanonicalType
2023-10-30 10:06:26 +00:00
Tamás Vajk
b9c89750b9 Merge pull request #14493 from tamasvajk/fix/params-attribute-argument
C#: Fix params attribute argument extraction
2023-10-30 10:50:02 +01:00
Mathias Vorreiter Pedersen
342b3d7733 Merge pull request #14619 from MathiasVP/fix-strtol-model
C++: Fix `strtol` model
2023-10-30 09:41:23 +00:00
Geoffrey White
1929dead39 Merge branch 'main' into implicitflow 2023-10-27 23:35:54 +01:00
Owen Mansel-Chan
c1ecd5a0da Merge pull request #14608 from Kwstubbs/golang-cookie-reflectedxss-sanitizer
Go: GoAdd Cookie Sanitizer to Reflected XSS
2023-10-27 21:47:39 +01:00
Kevin Stubbings
57cbacb495 test.go change 2023-10-27 12:07:51 -07:00
Kevin Stubbings
ce0104799a Fix minor issues 2023-10-27 11:42:22 -07:00
Geoffrey White
8937e0b313 Swift: == -> = 2023-10-27 17:18:09 +01:00
Alex Ford
cb1cd5ed2a Merge pull request #14560 from alexrford/rb/modgen
Ruby: add a query and script for autogenerating typeModel and summaryModel data extensions entries
2023-10-27 16:43:42 +01:00
Mathias Vorreiter Pedersen
33494fe9e1 C++: Extend the taint model and accept test changes. 2023-10-27 16:26:37 +01:00
Mathias Vorreiter Pedersen
e4683449cb C++: Add failing test. 2023-10-27 16:26:37 +01:00
Mathias Vorreiter Pedersen
8bf8888c24 C++: Simplify 'parameterNeverEscapes' and add a comment. 2023-10-27 16:26:37 +01:00
Mathias Vorreiter Pedersen
6062fbb475 Merge pull request #14383 from geoffw0/nsstringregex
Swift: Add regular expression evaluation models for StringProtocol and NSString methods
2023-10-27 15:49:23 +01:00
Mathias Vorreiter Pedersen
572cec2c55 C++: Accept test changes. 2023-10-27 15:00:25 +01:00
Mathias Vorreiter Pedersen
43e8b900bf C++: Fix 'strtol' model. 2023-10-27 14:59:11 +01:00
Geoffrey White
2a552d9721 Swift: Address QL-for-QL warning. 2023-10-27 14:56:19 +01:00
Mathias Vorreiter Pedersen
d6b6c432d9 C++: Add test with incorrect IR due to wrong model. 2023-10-27 14:53:06 +01:00
Owen Mansel-Chan
d534c93ff1 Merge pull request #14606 from owen-mc/go/incorrect-integer-conversion-fixes
Go: Two fixes to upper bound checks in "incorrect integer conversion" query
2023-10-27 14:50:11 +01:00
Alex Ford
f6ac63b259 Ruby: modgen - use FeatureEqualSourceSinkCallContext feature rather than late filtering for method context 2023-10-27 14:48:50 +01:00
Geoffrey White
12201d2e8e Swift: Codegen. 2023-10-27 14:37:06 +01:00
Geoffrey White
6ad5c9542b Swift: Add getCanonicalType to the NominalType test as well. 2023-10-27 14:37:06 +01:00
Dave Bartolomeo
b18a6d5e0b Merge pull request #14582 from github/dbartol/threat-models-2
Java: Threat model implementation with priorities.
2023-10-27 09:33:53 -04:00
Geoffrey White
ce471105e2 Swift: QLDoc getCanonicalType. 2023-10-27 14:23:51 +01:00
Mathias Vorreiter Pedersen
4aed638066 Merge pull request #14577 from MathiasVP/capture-flow-swift
Swift: Add variable-capture flow
2023-10-27 14:09:04 +01:00
Erik Krogh Kristensen
c1a1ebfb60 Merge pull request #14616 from erik-krogh/identity-severity
JS: lower the severity of js/identity-replacement to medium
2023-10-27 14:27:05 +02:00
Anders Schack-Mulligen
e9cb272396 Merge pull request #14615 from aschackmull/dataflow/stage-alias
Dataflow: simplify using stage aliases.
2023-10-27 14:17:30 +02:00
erik-krogh
cf958f0828 lower the severity of js/identity-replacement to medium 2023-10-27 13:54:17 +02:00
Anders Schack-Mulligen
10c657bc23 Dataflow: simplify using stage aliases. 2023-10-27 13:40:21 +02:00
Alex Ford
0818354ad7 Ruby: modgen - fix unbound variable 2023-10-27 11:46:09 +01:00
Owen Mansel-Chan
00ba7e42b1 Merge pull request #14613 from owen-mc/change-note-check-on-shared
Update `Change-note-check` workflow to detect changes in shared folder
2023-10-27 11:45:03 +01:00
Anders Schack-Mulligen
c7be5ac527 Merge pull request #14602 from aschackmull/java/split-dispatch-cached-stages
Java: Split the different layers of virtual dispatch into separate cached stages.
2023-10-27 12:36:29 +02:00
Owen Mansel-Chan
1db622e740 Make check-change-note workflow include shared 2023-10-27 11:26:13 +01:00
Mathias Vorreiter Pedersen
68999f3cef Swift: Fix test by including the 'allowParameterReturnInSelf' hook from the variable capture library. 2023-10-27 11:25:19 +01:00
Mathias Vorreiter Pedersen
9b150e4ea9 Swift: Add failing test. 2023-10-27 11:22:56 +01:00
Mathias Vorreiter Pedersen
a5a7d27c4b Swift: Add change note. 2023-10-27 11:16:32 +01:00
Owen Mansel-Chan
3c9783c7c9 Add change note 2023-10-27 11:12:37 +01:00
Mathias Vorreiter Pedersen
b41ec37993 Swift: Remove the code related to constructor capture (and the related TODO). This cannot happen in Swift. 2023-10-27 11:05:48 +01:00
Tom Hvitved
ee5c014382 Merge pull request #14609 from hvitved/csharp/stub-gen-attribute-usage
C#: Include `AttributeUsages` in stub generator
2023-10-27 12:05:34 +02:00
Owen Mansel-Chan
581305b234 Improve QLDoc for UpperBoundCheckGuard 2023-10-27 10:59:20 +01:00
Owen Mansel-Chan
8beacb8d4a Change predicate name from getX to getOrder 2023-10-27 10:44:42 +01:00
Mathias Vorreiter Pedersen
9cae488ef4 Merge pull request #14612 from aschackmull/dataflow/type-doc
Dataflow: Improve qldoc on the type system.
2023-10-27 10:39:57 +01:00
Mathias Vorreiter Pedersen
65e13aa5ed Swift: Add simple version of the 'captureList' test that works. 2023-10-27 10:27:35 +01:00
Mathias Vorreiter Pedersen
93234c0b5c Swift: Add model for 'withVaList' and accept test changes. 2023-10-27 10:21:12 +01:00
Mathias Vorreiter Pedersen
9e2dd09ddc Swift: Accept test regression (caused by no model for 'withVaList'). 2023-10-27 10:20:07 +01:00
Anders Schack-Mulligen
0f4ea10638 Merge pull request #14611 from aschackmull/dataflow/partialflow-changenote
Dataflow: Add change note for partial flow api change.
2023-10-27 10:57:17 +02:00
Anders Schack-Mulligen
776e35279d Dataflow: Improve qldoc on the type system. 2023-10-27 10:43:54 +02:00
Michael Nebel
e4276f7adb Java: Apply suggestions from code review
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2023-10-27 10:34:20 +02:00
Anders Schack-Mulligen
b106db6fda Dataflow: Add change note for partial flow api change. 2023-10-27 09:46:46 +02:00
Anders Schack-Mulligen
9769953669 Java: Split the different layers of virtual dispatch into separate cached stages. 2023-10-27 09:40:20 +02:00
Kevin Stubbings
52a0fdabcf formatting 2023-10-27 00:03:30 -07:00
Tom Hvitved
08d6379563 C#: Regenerate stubs for (Asp)NetCore.App 2023-10-27 08:34:55 +02:00
Tom Hvitved
abc16abf6f C#: Include AttributeUsages in stub generator 2023-10-27 08:34:20 +02:00
Kevin Stubbings
135923c9c1 Change XNetHtmltest 2023-10-26 20:48:38 -07:00
Mathias Vorreiter Pedersen
63525a9d9e Swift: Delete one TODO (it has been converted to an internal issue) and fix another. 2023-10-26 21:48:41 +01:00
Kevin Stubbings
e6e87a44a3 Add change note 2023-10-26 12:36:35 -07:00
Dave Bartolomeo
d2afb20f3f Merge remote-tracking branch 'origin/main' into dbartol/threat-models-2 2023-10-26 14:05:40 -04:00
Erik Krogh Kristensen
a5bfeb68a8 Merge pull request #14604 from erik-krogh/fix-thistype
JS: fix `TypeExprKinds` crashing on a `ThisExpression`
2023-10-26 20:05:26 +02:00
Dave Bartolomeo
9800458467 Update shared/threat-models/codeql/threatmodels/ThreatModels.qll
Co-authored-by: Michael Nebel <michaelnebel@github.com>
2023-10-26 13:46:55 -04:00
Dave Bartolomeo
927eb8424d Update shared/threat-models/codeql/threatmodels/ThreatModels.qll
Co-authored-by: Michael Nebel <michaelnebel@github.com>
2023-10-26 13:46:37 -04:00
Dave Bartolomeo
8d9e4d391f Update shared/threat-models/codeql/threatmodels/ThreatModels.qll
Co-authored-by: Michael Nebel <michaelnebel@github.com>
2023-10-26 13:46:28 -04:00
Alexander Eyers-Taylor
55ec9d0a91 Merge pull request #14601 from aschackmull/java/fix-tests
Java: Update tests to new partial flow api
2023-10-26 17:52:01 +01:00
Alex Ford
5a1a3f0727 Ruby: modgen - deduplicate getAnyParameter logic 2023-10-26 17:45:47 +01:00
Alex Ford
86ba75cadf Ruby: modgen - support self arguments 2023-10-26 17:42:46 +01:00
Alex Ford
6203887645 fixup 2023-10-26 17:38:43 +01:00
Mathias Vorreiter Pedersen
784bb72b33 Swift: Add some more tests. 2023-10-26 17:29:26 +01:00
Owen Mansel-Chan
b451adabfc Two small QLDoc improvements 2023-10-26 17:10:12 +01:00
Owen Mansel-Chan
896a3c65be Avoid doing float arithmetic with large integers
There is the possibility of overflow.
2023-10-26 17:09:53 +01:00
Owen Mansel-Chan
570ca3b6fe Fix upper bound check to make test pass 2023-10-26 17:08:19 +01:00
Alex Ford
24946c0dfd Ruby: modgen - restrict flow summaries to public methods 2023-10-26 17:05:31 +01:00
Alex Ford
fef2932f56 Apply suggestions from code review
Co-authored-by: Harry Maclean <hmac@github.com>
2023-10-26 17:04:51 +01:00
Owen Mansel-Chan
773f46d3b4 Add failing test for upper bound checks 2023-10-26 16:58:36 +01:00
Mathias Vorreiter Pedersen
30ecb4b0c8 Merge pull request #14588 from aschackmull/shared/rangeanalysis
C++/Java: Share core range analysis
2023-10-26 16:32:46 +01:00
yoff
867a39083e Merge pull request #14114 from yoff/python/allow-namespace-packages
Python: Allow namespace packages
2023-10-26 16:56:05 +02:00
erik-krogh
302199a74a fix TypeExprKinds crashing on a ThisExpression 2023-10-26 16:33:54 +02:00
Max Schaefer
abef8483bd Merge pull request #14600 from github/max-schaefer/express-rate-limit
JavaScript: Add support for importing `express-rate-limit` using a named import.
2023-10-26 15:15:22 +01:00
Mathias Vorreiter Pedersen
96a37f3a3c Swift: Simplify more tests. 2023-10-26 14:55:17 +01:00
Mathias Vorreiter Pedersen
2ad121a8a5 Swift: Simplify test. 2023-10-26 14:46:59 +01:00
Rasmus Lerchedahl Petersen
dcc778520a Python: refactor code
Also add explanatory comment.

Co-authored-by: Taus <tausbn@github.com>
2023-10-26 15:00:02 +02:00
Rasmus Lerchedahl Petersen
50041f07a3 Python: fix comment 2023-10-26 14:28:00 +02:00
Anders Schack-Mulligen
35f6e6ebb4 Java: Update tests to new partial flow api 2023-10-26 14:09:03 +02:00
Max Schaefer
aff848b038 Update javascript/ql/lib/semmle/javascript/security/dataflow/MissingRateLimiting.qll
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2023-10-26 13:06:52 +01:00
Jeroen Ketema
dbb4167f80 Merge pull request #14579 from jketema/ir-backwards
C++: Define an extractor version table and use in IR generation
2023-10-26 13:36:15 +02:00
Owen Mansel-Chan
0ed01453b9 Fix getMaxIntValue to accept bitSize 64 2023-10-26 12:27:43 +01:00
Max Schaefer
2c7291336d Move test files into right directory. 2023-10-26 12:16:52 +01:00
Max Schaefer
bb146a1758 JavaScript: Add support for rateLimit export from express-rate-limit package. 2023-10-26 12:14:57 +01:00
Mathias Vorreiter Pedersen
2465cc20f0 Swift: Don't define 'ClosureSelfParameterNode' as the expression node of the closure. 2023-10-26 11:56:27 +01:00
Jeroen Ketema
64004926bc C++: Use a more declarative predicate name 2023-10-26 12:07:19 +02:00
Jeroen Ketema
903f376620 C++: Define an extractor version table and use in IR generation 2023-10-26 12:07:19 +02:00
Mathias Vorreiter Pedersen
b1d4ca505d Merge pull request #14599 from aschackmull/dataflow/partialflow-separate
Dataflow: Restrict partial flow to either forward or reverse flow.
2023-10-26 11:01:03 +01:00
Anders Schack-Mulligen
bbc3cfba6f Dataflow: Fix documentation. 2023-10-26 11:29:16 +02:00
Anders Schack-Mulligen
a2e3b37847 Dataflow: Fix accidental visibility. 2023-10-26 11:28:52 +02:00
Chris Smowton
8198898d73 Merge pull request #14583 from smowton/smowton/admin/really-deprecate-old-java-names
Java: Deprecate MethodAccess and SuperMethodAccess
2023-10-26 10:25:05 +01:00
Owen Mansel-Chan
39eeed9238 Add failing test showcasing problem 2023-10-26 10:20:27 +01:00
Stephan Brandauer
5fe6a5a730 Merge pull request #14487 from github/kaeluka/extraction-query-docs
Java: basic version of automodel extraction query docs
2023-10-26 11:10:01 +02:00
Anders Schack-Mulligen
4dca4a7389 Dataflow: Restrict partial flow to either forward or reverse flow. 2023-10-26 10:33:03 +02:00
Anders Schack-Mulligen
ec58b209e3 Merge pull request #14584 from Marcono1234/kotlin-Literal-getLiteral
Kotlin: Mention `Literal::getLiteral()` difference from source code
2023-10-26 10:03:57 +02:00
Kevin Stubbings
21e4a5b2d5 Add Cookie Sanitizer 2023-10-25 22:07:08 -07:00
Chris Smowton
29d57d82b7 Deprecate MethodAccess and SuperMethodAccess 2023-10-25 22:26:38 +01:00
Jami
c7b9e405b7 Merge pull request #14517 from jcogs33/jcogs33/update-framework-cov-diff-workflow
CI: Update framework coverage difference commenter
2023-10-25 14:31:00 -04:00
Geoffrey White
2cfca032de Swift: Fix use of deprecated predicate. 2023-10-25 17:32:55 +01:00
Geoffrey White
82b92c38f9 Swift: Change method types to DataFlow::Node / go ahead with planned deprecations. 2023-10-25 17:11:21 +01:00
Geoffrey White
bfd150a1d3 Swift: Clarify comment. 2023-10-25 16:38:59 +01:00
Geoffrey White
ff15b73250 Swift: Update the change note. 2023-10-25 16:32:59 +01:00
Geoffrey White
4a08ca39d6 Swift: Replace PotentialRegexEval with a more specialized solution. 2023-10-25 16:26:46 +01:00
Alex Ford
16c5edd3ca Ruby: add a query and script for autogenerating typeModel and summaryModel data extensions entries 2023-10-25 15:52:02 +01:00
Mathias Vorreiter Pedersen
11194e574c Swift: Get rid of the unnecessary parameter/argument position for the closure. Instead, we can just reuse the 'this' parameter and argument. 2023-10-25 15:46:10 +01:00
Geoffrey White
354983087e Swift: this.(PotentialRegexEval) -> super. or this. . 2023-10-25 15:25:12 +01:00
Mathias Vorreiter Pedersen
951b6beeb1 Swift: Untangle the confusion between 'getParameter' and 'asParameter'. 2023-10-25 14:44:09 +01:00
Jeroen Ketema
990d7161b2 Merge pull request #14337 from aschackmull/cpp/container-not-locatable
C++: Remove getLocation from Container.
2023-10-25 15:37:57 +02:00
Mathias Vorreiter Pedersen
78e08cf63c Swift: Remove irrelevant TODO. 2023-10-25 13:55:07 +01:00
Anders Schack-Mulligen
6882504397 C#: Fix compilation 2023-10-25 14:31:49 +02:00
Anders Schack-Mulligen
5ded55cd9f C#: Sync Bound.qll 2023-10-25 14:08:48 +02:00
Anders Schack-Mulligen
283d6efdf8 Rangeanalysis/Java/C++: Address some ql4ql findings. 2023-10-25 14:06:35 +02:00
Jeroen Ketema
75a1173d63 C++: Add change note 2023-10-25 14:05:38 +02:00
Jeroen Ketema
dc512728fa C++: Make File extend Locatable 2023-10-25 14:05:38 +02:00
Jeroen Ketema
4ea5c13390 C++: Add back getLocation in File 2023-10-25 14:05:38 +02:00
Anders Schack-Mulligen
7124a53c9c C++: Remove getLocation from Container. 2023-10-25 14:05:38 +02:00
Jami
53d92d58fc Merge pull request #14581 from jcogs33/jcogs33/add-internal-to-model-exclusions
Java: exclude internal packages globally from MaD models
2023-10-25 08:04:03 -04:00
Michael Nebel
b3e5b86f0a Java: Cleanup threat models tests. 2023-10-25 14:02:31 +02:00
Mathias Vorreiter Pedersen
05385eb704 Merge pull request #14587 from MathiasVP/fix-indirect-strtok-model
C++: Fix `strtok` model for indirections
2023-10-25 12:09:13 +01:00
Owen Mansel-Chan
27646ce971 Merge pull request #14547 from owen-mc/go/enable-data-flow-consistency-checks
Go: make data flow consistency checks available (and fix some)
2023-10-25 11:15:44 +01:00
Geoffrey White
a3d53ba9ec Merge pull request #14574 from github/geoffw0-patch-2
Swift: Update README.md
2023-10-25 10:56:01 +01:00
Geoffrey White
7029f14651 Merge pull request #14511 from geoffw0/substring
Swift: Model Substring
2023-10-25 10:46:47 +01:00
Anders Schack-Mulligen
2592c94c54 Java: Replace range analysis with shared version. 2023-10-25 11:29:55 +02:00
Anders Schack-Mulligen
36082808d3 Java: Implement shared range analysis signatures. 2023-10-25 11:29:55 +02:00
Anders Schack-Mulligen
c1c4a5bfcf Rangeanalysis: Copy qldoc and simplification from Java. 2023-10-25 11:17:02 +02:00
Anders Schack-Mulligen
cd44d67529 Rangeanalysis: Add temporary Java compatibility flag. 2023-10-25 11:17:02 +02:00
Anders Schack-Mulligen
06fe10bbe9 Rangeanalysis: Bugfix division with float representation. 2023-10-25 11:17:02 +02:00
Anders Schack-Mulligen
7b214a24df C++: Add division test 2023-10-25 11:17:02 +02:00
Anders Schack-Mulligen
232c147f6b Rangeanalysis: Port join-order fix from Java version. 2023-10-25 11:17:02 +02:00
Anders Schack-Mulligen
ec39de20d8 C++: Convert to qlpack version of core range analysis. 2023-10-25 11:17:01 +02:00
Anders Schack-Mulligen
38274db205 Rangeanalysis: Parameterise library. 2023-10-25 11:17:01 +02:00
Anders Schack-Mulligen
169ba03778 Rangeanalysis: Copy C++ version verbatim. 2023-10-25 11:17:01 +02:00
Anders Schack-Mulligen
aed830cf1b Rangeanalysis: Make new qlpack 2023-10-25 11:17:01 +02:00
Mathias Vorreiter Pedersen
032572b924 C++: Fix 'strtok' model. 2023-10-25 09:39:36 +01:00
Mathias Vorreiter Pedersen
f54379d096 C++: Add failing test. 2023-10-25 09:38:49 +01:00
Tony Torralba
4920c7f8b0 Merge pull request #14585 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-10-25 10:02:50 +02:00
Stephan Brandauer
cffcc7334d Java: automodel extraction docs: add two intro sentences 2023-10-25 09:45:00 +02:00
Stephan Brandauer
0f2db1bcdb Java: automodel extraction docs: use markdown footnote 2023-10-25 09:32:59 +02:00
Stephan Brandauer
3eeb6ffec4 Java: automodel extraction docs: spell out positive and negative 2023-10-25 09:05:22 +02:00
Stephan Brandauer
44c87561b3 Java: review suggestion from adityasharad
Co-authored-by: Aditya Sharad <6874315+adityasharad@users.noreply.github.com>
2023-10-25 09:00:28 +02:00
Stephan Brandauer
c240c1b3f5 Java: review suggestions from aeisenberg
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
2023-10-25 08:59:21 +02:00
github-actions[bot]
6cbadece0e Add changed framework coverage reports 2023-10-25 00:15:35 +00:00
Marcono1234
bf20b8e5a5 Kotlin: Mention Literal::getLiteral() difference from source code
It appears the Kotlin extractor does not have access to the actual
string representation in the source code, and for most literal types
uses simply the represented value also as `getLiteral` result, see
https://github.com/github/codeql/blob/codeql-cli/v2.15.1/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt#L4443
2023-10-25 02:04:54 +02:00
Geoffrey White
8a5f3e4825 Swift: Fix an issue with RegexTracking.qll using PotentialRegexEval rather than RegexEval. 2023-10-24 22:49:19 +01:00
Jami
7c053ed428 CI: add .strip() to comment/ID file read
Co-authored-by: Aditya Sharad <6874315+adityasharad@users.noreply.github.com>
2023-10-24 17:48:38 -04:00
Geoffrey White
021ed88a0a Swift: Add a test revealing unevaluated regexs. 2023-10-24 22:42:15 +01:00
Chris Smowton
12d0f1a84b Merge pull request #14575 from github/smowton/feature/more-intuitive-java-class-names
Java: Replace MethodAccess, LValue, RValue with more intuitive names. Introduce NewClassExpr.
2023-10-24 19:01:37 +01:00
Dave Bartolomeo
33f10d8d19 Better handling of all threat model without too many binding sets 2023-10-24 13:59:15 -04:00
Cornelius Riemenschneider
790615fbc2 Merge pull request #14552 from github/criemen/bazel-js
Javascript extractor: Bazel-based build
2023-10-24 19:36:39 +02:00
Dave Bartolomeo
5fd56ce866 Alternate threat model implementation 2023-10-24 13:12:37 -04:00
Jami Cogswell
121fd0896b Java: exclude internal packages in general from models 2023-10-24 12:49:49 -04:00
Geoffrey White
42a2ec9891 Merge branch 'main' into substring 2023-10-24 17:03:00 +01:00
Geoffrey White
06b1cd939c Merge pull request #14502 from geoffw0/xmlquery
Swift: Model RawRepresentable
2023-10-24 16:25:15 +01:00
Chris Smowton
30610c9a3f Temporarily de-deprecate SuperMethodAccess to accommodate private tests 2023-10-24 16:05:52 +01:00
Geoffrey White
3bcee63980 Update README.md
Change the Warning to a Note and rephrase.
2023-10-24 15:46:32 +01:00
Mathias Vorreiter Pedersen
862de152a1 Swift: Add required qldoc. 2023-10-24 15:45:17 +01:00
Mathias Vorreiter Pedersen
6f37d7c374 Swift: Accept changes in paths. 2023-10-24 15:39:19 +01:00
Mathias Vorreiter Pedersen
9652679c6f Merge pull request #14568 from alexet/alexet/add-fn-tests
CPP: Add test demonstrating use-after-free false negatives.
2023-10-24 15:38:01 +01:00
Stephan Brandauer
e97456f5fc Java: automodel extraction docs: note on packaging and backwards compatibility 2023-10-24 16:30:59 +02:00
Mathias Vorreiter Pedersen
56b49a4de3 Swift: Add a closure flow step from the right-hand side of variable declarations to the underlying pattern. 2023-10-24 15:28:28 +01:00
Mathias Vorreiter Pedersen
3d5098aaeb Swift: Add failing test. 2023-10-24 15:28:25 +01:00
Mathias Vorreiter Pedersen
1c298e6001 Swift: Fix 'parameter' -> 'argument' flow into closures. 2023-10-24 15:28:01 +01:00
Mathias Vorreiter Pedersen
310ebe47b3 Swift: Clean up test file. 2023-10-24 15:27:59 +01:00
Cornelius Riemenschneider
42c343e820 Address review 2023-10-24 16:03:35 +02:00
Chris Smowton
92d3d9d83f Update integration test expectations 2023-10-24 14:47:19 +01:00
Chris Smowton
4205f1bd03 Temporarily un-deprecate MethodAccess to decouple from private tests 2023-10-24 14:03:26 +01:00
Chris Smowton
b849a66c97 Update test expectations 2023-10-24 14:02:30 +01:00
Nora Dimitrijević
9dbf7e818d Swift: align definition of InputSig slightly closer to Java version
Though there is a regression in the tests, so more work is needed.
2023-10-24 13:56:31 +01:00
Nora Dimitrijević
9de3cc703a Swift: add CapturePostUpdateNode
However, this doesn't change any of the test results.
2023-10-24 13:56:31 +01:00
Nora Dimitrijević
5418d39a0d Swift: add and accept a few new simple test cases 2023-10-24 13:56:31 +01:00
Nora Dimitrijević
af49a3aa64 Swift: accept new results in old tests 2023-10-24 13:56:31 +01:00
Nora Dimitrijević
8115774a7a Swift: Add the capture flow step as part of the normal data flow relation
TODO: see if we need to exclude duplicate SSA steps
2023-10-24 13:56:31 +01:00
Nora Dimitrijević
4e1b44a059 Swift: port simpleAstFlowStep/hasAliasedAccess 2023-10-24 13:56:31 +01:00
Nora Dimitrijević
21a369de13 Swift: Add closure content read-write steps 2023-10-24 13:56:31 +01:00
Nora Dimitrijević
c04654d8f9 Swift: getImmediateBasicBlockDominator/2 should use immediatelyDominates/0. 2023-10-24 13:56:31 +01:00
Nora Dimitrijević
95a7d6559c Swift: initial version of a swift port of most of the java code 2023-10-24 13:56:31 +01:00
Nora Dimitrijević
3253c0425c Swift: s/getName/getShortName/ in InlineFlowTest.qll 2023-10-24 13:56:31 +01:00
Nora Dimitrijević
050b8e682f Swift: add failing inline expectation test based on closure AST tests. 2023-10-24 13:56:31 +01:00
Jeroen Ketema
ba67217b44 Merge pull request #14571 from MathiasVP/fix-indirect-taint
C++: Fix indirect taint
2023-10-24 14:47:43 +02:00
Chris Smowton
06238dd5f6 Improve reflective class names 2023-10-24 13:29:32 +01:00
Chris Smowton
011666b48c Fix description and improve predicate name of VarWrite. 2023-10-24 12:59:57 +01:00
Chris Smowton
ede17585a6 Amend NewClassExpr description
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2023-10-24 12:51:42 +01:00
Chris Smowton
e3edea2a5f Apply simple suggestions from code review
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2023-10-24 12:51:03 +01:00
Stephan Brandauer
eb97ce3294 Java: automodel extraction query docs, candidate examples 2023-10-24 13:49:38 +02:00
Chris Smowton
efb63aada3 Add change note 2023-10-24 11:45:41 +01:00
Chris Smowton
3627eb2bcf Add missing qldoc 2023-10-24 11:15:08 +01:00
Chris Smowton
e8c9708282 Autoformat 2023-10-24 11:06:19 +01:00
Chris Smowton
09e83d1173 Fix isEnclosingMethodAccess wrapper 2023-10-24 11:03:57 +01:00
Chris Smowton
ac38d4c9c6 Mass rename L/RValue -> VarWrite/Read 2023-10-24 10:58:29 +01:00
Chris Smowton
59a49eef0b Add aliases for public, importable renamed classes and predicates.
Also rename and aliases a couple of uses of Access noted along the way.
2023-10-24 10:54:35 +01:00
Chris Smowton
f552a15aae Mass-rename MethodAccess -> MethodCall 2023-10-24 10:30:26 +01:00
Geoffrey White
f597f0272a Update README.md
Turned the warning at the top into a warning box.

Made the section headers consistent.

I was going to add a section, but I realized it belongs somewhere else.  :)
2023-10-24 10:12:20 +01:00
Michael Nebel
26f767073d Merge pull request #14363 from michaelnebel/csharp/sunsetqlstubgen
C#: Sunset QL based stub generator.
2023-10-24 11:05:56 +02:00
Chris Smowton
a10731c591 Java: introduce more-intuitive names for ClassInstanceExpr, L/RValue and MethodAccess. 2023-10-24 09:38:49 +01:00
Mathias Vorreiter Pedersen
1fce26534f C++: Remove implied conjunct. 2023-10-24 09:25:32 +01:00
Tony Torralba
4e823b4306 Merge pull request #14566 from atorralba/atorralba/java/springframework-6-models
Java: Added up to date models for Spring's ResponseEntity
2023-10-24 09:11:37 +02:00
Mathias Vorreiter Pedersen
67ed12c916 C++: Correctly model that 'operator->', and 'get'
on smart pointers perform a load.
2023-10-23 20:11:23 +01:00
Mathias Vorreiter Pedersen
b107c4c641 C++: Fix missing result in 'ModelUtil'. The problem was that 'n.asInstruction()' on line 81 wasn't necessarily a 'CallInstruction' (it could be a conversion). 2023-10-23 19:34:25 +01:00
Mathias Vorreiter Pedersen
c0b04eac7c C++: Add failing test. 2023-10-23 19:29:28 +01:00
Alex Eyers-Taylor
26b0363707 CPP: Add test demonstrating use-after-free false negatives. 2023-10-23 17:01:52 +01:00
Paolo Tranquilli
140ff723e4 Merge pull request #14563 from github/redsun82/codegen-test-with
Codegen: add `@qltest.test_with`
2023-10-23 17:35:31 +02:00
Joe Farebrother
3f11d83b7b Merge pull request #14500 from joefarebrother/shared-filepath-normalize
Shared: Add library for filepath normalization
2023-10-23 16:09:44 +01:00
Paolo Tranquilli
02a2debe94 Codegen: fix python compatibility problem 2023-10-23 16:56:44 +02:00
Tony Torralba
cd10dc8a27 Java: Added up to date models for Spring's ResponseEntity 2023-10-23 16:06:11 +02:00
Chris Smowton
e301223644 Merge pull request #14541 from JarLob/patch-3
fix CWE number
2023-10-23 15:05:02 +01:00
Michael Nebel
743be92624 C#: Adjust workflow to point to the new location for the script. 2023-10-23 15:10:20 +02:00
Michael Nebel
5ba0e0ffce C#: Adjust the relative path to the stub generator project file. 2023-10-23 15:09:38 +02:00
Michael Nebel
d4af05cbf9 C#: Move stub generator script. 2023-10-23 15:09:38 +02:00
Michael Nebel
ed6a068ebc C#: Update the stub generator readme. 2023-10-23 15:09:38 +02:00
Michael Nebel
4e99266b65 C#: Sunset the QL based stub generator. 2023-10-23 15:09:38 +02:00
Paolo Tranquilli
7cc20587ad Codegen: add @qltest.test_with
This allows to group together related AST classes to reuse the same
test source and extraction. For example this is useful for
`EnumDecl/EnumCaseDecl/EnumElementDecl`, where this is applied to.
2023-10-23 14:51:22 +02:00
Ian Lynagh
b89088737a Merge pull request #14551 from igfoo/igfoo/loc
Java/Kotlin: Reshuffle our LoC queries
2023-10-23 11:50:03 +01:00
Stephan Brandauer
319b799f95 Merge pull request #14553 from github/kaeluka/fix-positive-example-query
Java: Automodel Framework Mode Extraction Bug
2023-10-23 09:48:49 +02:00
Jami Cogswell
687ecffe71 CI: don't upload comment/ID artifact if no existing comment 2023-10-22 15:28:07 -04:00
Owen Mansel-Chan
b46174f464 Merge pull request #14536 from owen-mc/go/amend-library-coverage
Go: Add Go frameworks for automated coverage reports
2023-10-20 21:28:30 +01:00
Dave Bartolomeo
76a9b71231 Merge branch 'main' into dbartol/threat-models 2023-10-20 14:05:17 -04:00
Stephan Brandauer
1d7c2f4799 Java: format 2023-10-20 16:37:46 +02:00
Stephan Brandauer
f0c0bbf4c8 remove bug: needless restriction to sink examples in framework mode +examples 2023-10-20 16:34:29 +02:00
Mathias Vorreiter Pedersen
6c10ba2fb1 Merge pull request #14495 from github/calumgrant/comp-generated-this
C++: Fix ImplicitThisFieldAccess
2023-10-20 15:25:26 +01:00
Cornelius Riemenschneider
9ba32a0440 Add bazel-based build for the Javascript extractor. 2023-10-20 16:23:50 +02:00
Cornelius Riemenschneider
de85f2bbf8 Fix errorprone violations. 2023-10-20 16:23:35 +02:00
Calum Grant
8054a5d086 C++: Add changenote 2023-10-20 14:48:20 +01:00
Owen Mansel-Chan
0ba0063e6d Update go/ql/lib/change-notes/2023-10-20-enclosing-callable-for-external-files.md
Co-authored-by: Michael B. Gale <mbg@github.com>
2023-10-20 13:37:44 +01:00
Erik Krogh Kristensen
f562d5319f Merge pull request #14539 from flyboss/main
fix typo ('Configration' to ‘Configuration’)
2023-10-20 14:10:42 +02:00
Ian Lynagh
26634a3266 Java/Kotlin: Add a changenote for the lines-of-code changes 2023-10-20 13:04:39 +01:00
Ian Lynagh
d816035da6 Java/Kotlin: Tweak LoC message 2023-10-20 13:02:11 +01:00
Ian Lynagh
13a9e83e6a Java/Kotlin: Reshuffle our LoC queries
There's now a single lines-of-code query that gives the total number of
lines of code over both languages.

Per-language LoC queries are now just summaries.
2023-10-20 12:43:41 +01:00
Paolo Tranquilli
c92519ed6b Merge pull request #14538 from github/redsun82/add-unspecified-element-children
Swift: add children to `UnspecifiedElement`
2023-10-20 12:27:05 +02:00
Owen Mansel-Chan
da68153a96 Fix change note name and location 2023-10-20 11:24:25 +01:00
Owen Mansel-Chan
5d729616cd Add change note 2023-10-20 11:20:10 +01:00
Michael B. Gale
58fe66f5a8 Merge pull request #14550 from github/mbg/docs/bump-to-go1.21
Bump to Go 1.21 in supported compilers docs
2023-10-20 11:09:59 +01:00
flyboss
ee813c1e61 Update UnsafeHtmlConstructionQuery.qll
add a deprecated alias in case anyone depends on the misspelled name.
2023-10-20 17:57:23 +08:00
Michael B. Gale
46aa712c28 Bump to Go 1.21 in supported compilers docs 2023-10-20 10:49:02 +01:00
Esben Sparre Andreasen
1b9b6ae5b5 Merge pull request #14542 from github/esbena/proper-check-change-note
Improve change note checking
2023-10-20 11:47:53 +02:00
Ian Lynagh
a4ef183a2e Merge pull request #14529 from igfoo/igfoo/classid_fqname
Kotlin: Don't convert back and forth between ClassId and FqName
2023-10-20 10:28:25 +01:00
Jami Cogswell
ee4a9c3f8d CI: remove extraneous quotes that were causing 'get_previous_run_id' to always fail with a 'list index out of bounds' error 2023-10-19 19:23:14 -04:00
Jami Cogswell
6e29b70100 CI: update comment (if it exists) 2023-10-19 19:19:25 -04:00
Jami Cogswell
9263cfdf56 CI: save and upload comment id (if it exists) 2023-10-19 19:14:23 -04:00
Dave Bartolomeo
15e9838f16 Add a readme file 2023-10-19 17:27:21 -04:00
Dave Bartolomeo
fb1b41b649 Fix formatting 2023-10-19 17:20:38 -04:00
Dave Bartolomeo
c268163804 warnOnImplicitThis 2023-10-19 17:18:47 -04:00
Dave Bartolomeo
910b2a98f1 Merge remote-tracking branch 'origin/main' into dbartol/threat-models 2023-10-19 17:07:38 -04:00
Dave Bartolomeo
bd7de83aab Use extension packs for threat models 2023-10-19 17:07:26 -04:00
Dave Bartolomeo
07eb60d044 Merge pull request #14531 from github/post-release-prep/codeql-cli-2.15.1
Post-release preparation for codeql-cli-2.15.1
2023-10-19 13:32:33 -04:00
Dave Bartolomeo
712f7758cf Merge branch 'main' into post-release-prep/codeql-cli-2.15.1 2023-10-19 12:14:07 -04:00
Owen Mansel-Chan
e19ebf9ca8 Add external file scope 2023-10-19 16:48:38 +01:00
Owen Mansel-Chan
563805ff0c Fix nodeGetEnclosingCallable
It wasn't updated when MkImplicitVarargsSlice was added as a branch of
TNode. This meant that it gave no result for `ImplicitVarargsSlice`s
in function calls used to initialise variables declared at file level.
2023-10-19 16:48:37 +01:00
Owen Mansel-Chan
a3cecd178f Add consistency query
This can be run on an existing database to check for any assumptions
of the data flow library which do not hold.
2023-10-19 16:47:56 +01:00
Erik Krogh Kristensen
2a1ca637fd Merge pull request #14543 from erik-krogh/string-not-int
move the documentation of codePointAt and codePointCount to the string type instead of the int type
2023-10-19 14:39:10 +02:00
erik-krogh
5cd732b3c6 move the documentation of codePointAt and codePointCount to the string type instead of the int type 2023-10-19 12:57:06 +02:00
Owen Mansel-Chan
67601b5312 Add DataFlowImplConsistency.qll for Go library 2023-10-19 11:43:00 +01:00
Mathias Vorreiter Pedersen
0ab159f803 Merge pull request #14135 from github/sashabu/frontend-update
C++: Update for changes in frontend.
2023-10-19 11:40:24 +01:00
Esben Sparre Andreasen
2c99e2f3d5 improve change note file name checks 2023-10-19 12:16:27 +02:00
Esben Sparre Andreasen
836bb6006c improve env var usage in check-change-note.yml 2023-10-19 12:05:29 +02:00
Mathias Vorreiter Pedersen
0bfa53cfd6 Merge pull request #14524 from MathiasVP/add-more-dataflow-documentation
C++: Add more documentation about dataflow through indirections
2023-10-19 10:32:12 +01:00
Mathias Vorreiter Pedersen
4feda50add Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-19 11:00:42 +02:00
Mathias Vorreiter Pedersen
b5cbd909f7 Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-19 11:00:33 +02:00
Mathias Vorreiter Pedersen
35702a9fdf Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-19 11:00:18 +02:00
Jeroen Ketema
a972d0943a C++: Accept test changes after changes in IR generation 2023-10-19 10:45:14 +02:00
Jeroen Ketema
2a64552979 C++: Add support for C23/C++23 floating-point types 2023-10-19 10:45:14 +02:00
Jeroen Ketema
7e71d9e619 C++: Update expected test results after outputting less loads from the extractor 2023-10-19 10:45:14 +02:00
Jeroen Ketema
bec3e62771 C++: Update cpp/constant-array-overflow test results after frontend update 2023-10-19 10:45:14 +02:00
Jeroen Ketema
23c6027386 C++: Update expected test changes after frontend update 2023-10-19 10:45:13 +02:00
Jeroen Ketema
8b8a2726d4 C++: Accept semantic range analysis test changes due to extra loads in the IR 2023-10-19 10:45:13 +02:00
Jeroen Ketema
554087161b C++: Accept sign analysis test changes
The IR now contains extra loads that need to be accounted for.
2023-10-19 10:45:13 +02:00
Jeroen Ketema
5036135f01 C++: Fix IR generation for the comma operator 2023-10-19 10:45:13 +02:00
Jeroen Ketema
0fceecee6d C++: Fix extractor options for deprecated_with_msg test
The previous extractor options no longer work, because the default assumed
compiler versions have changed in the frontend.
2023-10-19 10:45:13 +02:00
Jeroen Ketema
e271c7e5e7 C++: Accept IR GVN test changes a CopyValue is now Load due to IR changes 2023-10-19 10:45:13 +02:00
Jeroen Ketema
91a98f3512 C++: Accept new dataflow IR inconsistencies
These are due to additional loads being generated on fields, and should not
cause any problems. Ideally, we should tune the definition of
`TPostFieldUpdateNode` to make these go away.
2023-10-19 10:45:13 +02:00
Jeroen Ketema
231e9ef098 C++: Accept PrintAST value category changes after frontend update 2023-10-19 10:45:13 +02:00
Jeroen Ketema
a6dae91215 C++: Accept IR test changes after value category updates 2023-10-19 10:45:12 +02:00
Jeroen Ketema
3202bcce70 C++: Handle ternary operators whose value category is a prvalue with a load 2023-10-19 10:45:12 +02:00
Jeroen Ketema
c60cb136bb C++: Do not generate loads for ParenthesisExprs 2023-10-19 10:45:12 +02:00
Jeroen Ketema
4339e18ed6 C++: Update IR generation for changes in frontend 2023-10-19 10:45:12 +02:00
Jaroslav Lobačevski
2b541b78ac fix CWE number 2023-10-19 09:36:25 +02:00
Tony Torralba
049ba54948 Merge pull request #14533 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-10-19 08:56:36 +02:00
Erik Krogh Kristensen
daca5121f6 Merge pull request #14540 from github/dependabot/cargo/ql/tracing-0.1.40
Bump tracing from 0.1.39 to 0.1.40 in /ql
2023-10-19 08:47:56 +02:00
dependabot[bot]
2af1302a4a Bump tracing from 0.1.39 to 0.1.40 in /ql
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.39 to 0.1.40.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.39...tracing-0.1.40)

---
updated-dependencies:
- dependency-name: tracing
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-19 03:33:14 +00:00
flyboss
86336565eb fix typo 2023-10-19 02:34:31 +00:00
github-actions[bot]
065353667f Add changed framework coverage reports 2023-10-19 00:15:51 +00:00
Tony Torralba
da44b13fd4 Merge pull request #14515 from atorralba/atorralba/java/spring-csrf-improv
Java: Improve java/spring-disabled-csrf-protection
2023-10-18 17:49:10 +02:00
Paolo Tranquilli
d55289bf68 Swift: add children to UnspecifiedElement
This will allow better downgrade scripts in the future.
2023-10-18 16:42:04 +02:00
Michael B. Gale
4246ebf9e0 Merge pull request #14535 from github/mbg/go/dependabot-ignore-tests
Go: Add Dependabot config for `go/ql/test` which ignores all dependencies
2023-10-18 14:40:16 +01:00
Michael B. Gale
771b5eca47 No allow, only ignore 2023-10-18 14:25:38 +01:00
Michael B. Gale
10e9c6defd Update .github/dependabot.yml
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2023-10-18 14:23:32 +01:00
Michael B. Gale
df191e4b6d Update .github/dependabot.yml
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2023-10-18 14:22:06 +01:00
Mathias Vorreiter Pedersen
7f97492580 C++: Make sphinx happy. 2023-10-18 14:15:55 +01:00
Mathias Vorreiter Pedersen
a36d432184 C++: Simplify a paragraph and use line numbers in CPP code. 2023-10-18 14:15:01 +01:00
Mathias Vorreiter Pedersen
c04546da98 C++: Use named code blocks. 2023-10-18 14:03:09 +01:00
Mathias Vorreiter Pedersen
308d027d1e C++: Fix typo. 2023-10-18 14:02:05 +01:00
Mathias Vorreiter Pedersen
44e214b933 C++: Stick to the pointer vs. indirection terminology. 2023-10-18 13:47:09 +01:00
Mathias Vorreiter Pedersen
f6b1d66167 C++: Convert another paragraph to a numbered list. 2023-10-18 13:38:50 +01:00
Mathias Vorreiter Pedersen
1b1a78bf04 C++: Convert a paragraph to a numbered list. 2023-10-18 13:34:32 +01:00
Mathias Vorreiter Pedersen
342f4f867b Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst 2023-10-18 14:30:46 +02:00
Mathias Vorreiter Pedersen
9d2e21e470 C++: Move the note in the beginning of the document into a reusable file. 2023-10-18 13:29:52 +01:00
Mathias Vorreiter Pedersen
ff3d4b8b40 Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:18:23 +02:00
Mathias Vorreiter Pedersen
3b6c43c9a1 Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:18:05 +02:00
Mathias Vorreiter Pedersen
8812567c69 Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:15:11 +02:00
Mathias Vorreiter Pedersen
0d36d918c9 Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:11:58 +02:00
Mathias Vorreiter Pedersen
d4cbb8cb22 Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:11:24 +02:00
Mathias Vorreiter Pedersen
9a91145d7e Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:09:39 +02:00
Mathias Vorreiter Pedersen
efe7153ac2 Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:09:05 +02:00
Mathias Vorreiter Pedersen
9ad461daa0 Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:08:40 +02:00
Mathias Vorreiter Pedersen
59b26c0dad Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst 2023-10-18 14:08:20 +02:00
Mathias Vorreiter Pedersen
b71248face Update docs/codeql/codeql-language-guides/codeql-for-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:06:14 +02:00
Mathias Vorreiter Pedersen
dc77614bd1 Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:05:59 +02:00
Mathias Vorreiter Pedersen
56a1a7cc4d Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:05:45 +02:00
Mathias Vorreiter Pedersen
f3dd2ebe7d Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:05:19 +02:00
Mathias Vorreiter Pedersen
16fbffe47b Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:05:05 +02:00
Mathias Vorreiter Pedersen
51cf400669 Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:04:39 +02:00
Mathias Vorreiter Pedersen
02e3d2704c Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:03:50 +02:00
Mathias Vorreiter Pedersen
e6ae3ffe7a Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:03:41 +02:00
Mathias Vorreiter Pedersen
d21943137f Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-10-18 14:03:28 +02:00
Owen Mansel-Chan
bddd448fdf Add Go frameworks for automated coverage reports
Note that the space at the beginning of the package patterns for the
standard library is deliberate, because builtin functions use the empty
string as their package and we want to attribute them to the standard
library.
2023-10-18 12:49:31 +01:00
Calum Grant
6472ed7fe0 C++: Fix GVN for ImplicitThisFieldAccess 2023-10-18 12:40:55 +01:00
Calum Grant
c51efb1477 C++: Tighten up definitions of field accesses 2023-10-18 11:39:09 +01:00
Michael B. Gale
bd811f25da Add Dependabot config for go/ql/test 2023-10-18 11:06:02 +01:00
github-actions[bot]
8dcd8b9e5b Post-release preparation for codeql-cli-2.15.1 2023-10-17 20:24:00 +00:00
Chris Smowton
70aa490bbd Merge pull request #14503 from smowton/smowton/admin/adapt-tests-to-jdk21
Java: Adapt tests to JDK21
2023-10-17 20:07:47 +01:00
Edward Minnix III
15afc3ed64 Merge pull request #14491 from egregius313/egregius313/java/mad/convert-iv
Java: Refactor `java/static-initialization-vector` to use Models as Data
2023-10-17 13:15:45 -04:00
Geoffrey White
b93442a2b6 Merge pull request #14523 from geoffw0/appendingformat
Swift: Model StringProtocol.appendingformat and String.decodecstring
2023-10-17 18:04:29 +01:00
Ian Lynagh
ab891465a4 Kotlin: Don't convert back and forth between ClassId and FqName
This showed up as a bug in Kotlin 2 mode:

We were starting with the Class Id "java/util/Map.Entry", which we then
converted to the FqName "java.util.Map.Entry", and then back to a
Class Id with ClassId.topLevel. This gave us a Class Id that
referenceClass wasn't able to resolve.

Now we just stick with the Class Id that we started with, and the class
can be resolved by Kotlin 2.
2023-10-17 17:01:53 +01:00
Robert Marsh
53e80e0f27 Merge pull request #14398 from rdmarsh2/rdmarsh2/swift/autoclosure-cfg
Swift: add CFG for normal autoclosures
2023-10-17 11:50:24 -04:00
Mathias Vorreiter Pedersen
c8e8ac0b55 C++: Make sphinx happy. 2023-10-17 16:15:59 +01:00
Mathias Vorreiter Pedersen
9a6fc967db Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2023-10-17 17:05:27 +02:00
Mathias Vorreiter Pedersen
17ee7c2352 Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2023-10-17 17:04:33 +02:00
Mathias Vorreiter Pedersen
c4075b3ec7 C++: Make an explanation of 'allowImplicitRead' slightly more explicit. 2023-10-17 16:02:48 +01:00
Mathias Vorreiter Pedersen
d390b6235b C++: Delete 'we assume'. 2023-10-17 16:00:09 +01:00
Ed Minnix
8ed5bfb27d Remove reference to DataFlow2 2023-10-17 10:59:36 -04:00
Mathias Vorreiter Pedersen
0a71705dfe C++: Add a small note about performance. 2023-10-17 15:57:37 +01:00
Mathias Vorreiter Pedersen
2fcf0abb7f C++: Fix phinx syntax. 2023-10-17 15:45:16 +01:00
Mathias Vorreiter Pedersen
c5307bed2b C++: Replace 'use_data' with 'read_data'. 2023-10-17 15:36:14 +01:00
Mathias Vorreiter Pedersen
d6ccd63ed2 C++: Reorganize the setup in the 'Flow from a qualifier to a field access' section. 2023-10-17 15:33:25 +01:00
Mathias Vorreiter Pedersen
3de32e813b C++: Simplify introductory text and code. 2023-10-17 15:19:59 +01:00
Mathias Vorreiter Pedersen
bbf9bcde2a Merge pull request #14482 from MathiasVP/additional-call-targets-for-cpp
C++: Add an abstract class that can be used to extend `viableCallable`
2023-10-17 14:57:21 +01:00
Mathias Vorreiter Pedersen
e264bddb25 Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2023-10-17 15:51:20 +02:00
Mathias Vorreiter Pedersen
fa3053f7fa Update docs/codeql/codeql-language-guides/advanced-dataflow-scenarios-cpp.rst
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2023-10-17 15:50:55 +02:00
AlexDenisov
401639e10b Merge pull request #14528 from github/alexdenisov/debug-notes-on-db-upgrades
Docs: add a note on db migration scripts debugging
2023-10-17 15:49:39 +02:00
Alex Denisov
057172c391 Docs: add a note on db migration scripts debugging 2023-10-17 14:55:35 +02:00
Rasmus Wriedt Larsen
28bedda5ea Merge pull request #14513 from RasmusWL/yield-modeling
Python: Improve `yield` modeling
2023-10-17 14:15:01 +02:00
Stephan Brandauer
9d719aa44e Merge pull request #13444 from github/java/update-mad-decls-after-triage-2023-06-13T14-50-57
Java: Update MaD Declarations after Triage
2023-10-17 13:54:10 +02:00
Joe Farebrother
aa418dc7d0 Add more line breaks in qldoc 2023-10-17 12:51:22 +01:00
Mathias Vorreiter Pedersen
68f2501bf0 Merge pull request #14496 from geoffw0/memberinittest
Swift: Add data flow tests for member initialization.
2023-10-17 12:35:07 +01:00
Mathias Vorreiter Pedersen
9a2c1daebe C++: Add tests for 'AdditionalCallTarget'. 2023-10-17 11:48:44 +01:00
Geoffrey White
5ffb773568 Swift: Explore instantiated / not instantiated classes. 2023-10-17 11:30:03 +01:00
Mathias Vorreiter Pedersen
0ad338f04a Merge pull request #14521 from geoffw0/defaultstep
Swift: Add CollectionContent to defaultImplicitTaintRead
2023-10-17 11:07:10 +01:00
Tony Torralba
96d6e8e3f2 Update change note 2023-10-17 11:57:53 +02:00
Tony Torralba
3cd06b0026 More review suggestions 2023-10-17 11:54:32 +02:00
Tony Torralba
62a9ffd277 Apply suggestions from code review 2023-10-17 11:51:55 +02:00
Mathias Vorreiter Pedersen
75a8f01f65 C++: Add more documentation about dataflow through indirections. 2023-10-17 09:53:40 +01:00
Tony Torralba
4ecda9cccd Add consistency check exception 2023-10-17 10:18:19 +02:00
Rasmus Wriedt Larsen
80506f1028 Python: Accept .expected changes 2023-10-17 10:11:39 +02:00
Rasmus Wriedt Larsen
62a992473f Python: Update QLDoc 2023-10-17 10:09:19 +02:00
Rasmus Wriedt Larsen
2bf4c32433 Python: Add syntactic support for yield in contextlib.contextmanager 2023-10-17 09:51:20 +02:00
Rasmus Wriedt Larsen
2399793c8a Python: Expand contextmanager test even more 2023-10-17 09:41:30 +02:00
Chris Smowton
3145c53a19 Accept test changes for JDK21 2023-10-16 22:00:41 +01:00
Chris Smowton
bd77f572f1 Compile collections test for Java 11 2023-10-16 21:54:09 +01:00
Geoffrey White
0a96eb0a40 Swift: Change note. 2023-10-16 21:43:55 +01:00
Geoffrey White
2679d1fdb5 Swift: Add models. 2023-10-16 21:40:38 +01:00
Erik Krogh Kristensen
24e779b826 Merge pull request #14520 from github/dependabot/cargo/ql/regex-1.10.2
Bump regex from 1.10.0 to 1.10.2 in /ql
2023-10-16 22:27:50 +02:00
Geoffrey White
451d779f4a Swift: Test String.decodeCString. 2023-10-16 21:22:03 +01:00
Geoffrey White
459b006244 Swift: Test StringProtocol.appendingFormat. 2023-10-16 21:22:03 +01:00
dependabot[bot]
cf0173acad Bump regex from 1.10.0 to 1.10.2 in /ql
Bumps [regex](https://github.com/rust-lang/regex) from 1.10.0 to 1.10.2.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.0...1.10.2)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-16 17:49:47 +00:00
Michael B. Gale
d15c60ba76 Merge pull request #14516 from github/mbg/go/fix-dependabot-yml-again 2023-10-16 18:48:26 +01:00
Geoffrey White
c6ff42986d Swift: Change note. 2023-10-16 18:43:03 +01:00
Geoffrey White
990c40c8c8 Swift: Barrier for duplicate results in constant queries, resulting from sources like [1, 2, 3]. 2023-10-16 18:28:51 +01:00
Geoffrey White
6108f787dd Swift: Effect on query tests. 2023-10-16 18:28:51 +01:00
Geoffrey White
0509c0fdf3 Swift: Effect on dataflow tests. 2023-10-16 18:28:50 +01:00
Geoffrey White
89867d6214 Swift: Default content read step. 2023-10-16 18:28:50 +01:00
Robert Marsh
efb04f6db4 Swift: update generated files list 2023-10-16 17:22:52 +00:00
Robert Marsh
d0ec2fd643 Swift: fix QLDoc typos
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2023-10-16 13:20:41 -04:00
Ed Minnix
c65d407937 Remove old DataFlow2 import 2023-10-16 10:30:00 -04:00
Tony Torralba
d08ee76b16 Java: Improve java/spring-disabled-csrf-protection 2023-10-16 16:01:14 +02:00
Michael B. Gale
8c818a8657 group => groups 2023-10-16 14:53:03 +01:00
Mathias Vorreiter Pedersen
26a665369b C++: Add QLDoc. 2023-10-16 14:15:55 +01:00
Joe Farebrother
05162c68ec Fix typo 2023-10-16 13:43:06 +01:00
Joe Farebrother
aade79f723 Improve qldoc and fix changenote 2023-10-16 13:02:28 +01:00
Geoffrey White
1f92267786 Swift: Sort out identical files situation. 2023-10-16 11:26:12 +01:00
Geoffrey White
890b9d59ed Swift: Fix line numbers. 2023-10-16 11:09:54 +01:00
Rasmus Wriedt Larsen
883bd9f3b3 Python: Add test for type-tracking with yield 2023-10-16 12:09:07 +02:00
Geoffrey White
225a9fe2d8 Merge branch 'main' into implicitflow 2023-10-16 11:02:34 +01:00
Geoffrey White
0e1da37379 Revert "Swift: Hide OpenExistentialExpr from the AST instead."
This reverts commit 9ad1749957.
2023-10-16 10:49:39 +01:00
Geoffrey White
39a6375606 Swift: Change note. 2023-10-16 10:17:32 +01:00
Geoffrey White
613c7b24b5 Swift: Model .base, withUTF8(_:). 2023-10-16 10:17:32 +01:00
Geoffrey White
0bc24b8641 Swift: Model replaceSubrange more generally. 2023-10-16 10:17:32 +01:00
Geoffrey White
c6f2a2936b Swift: Widen the StringProtocol model. 2023-10-16 10:14:43 +01:00
Geoffrey White
dcba1b9913 Swift: Tests for Substring. 2023-10-16 10:14:42 +01:00
Chris Smowton
7fbba3a659 Java: adapt stub to ExecutorService change in JDK19 2023-10-13 20:30:28 +01:00
Chris Smowton
8f985e0045 Java: restrict test to source classes 2023-10-13 20:30:28 +01:00
Chris Smowton
0510b0c825 Java: restrict test to source methods
Otherwise it finds standard library methods that depend on stdlib internals as to what happens to get extracted. In particular the extractor bump to JDK21 led to MethodHandles being in scope and a new method being found; seems better to avoid considering the standard library at all.
2023-10-13 20:30:28 +01:00
Geoffrey White
cea87a53e0 Swift: Fix LocalTaint.expected. 2023-10-13 18:19:26 +01:00
Ed Minnix
3356261031 Static IV refactor to MaD 2023-10-13 12:50:49 -04:00
Geoffrey White
e2ac3769bc Swift: Change note. 2023-10-13 17:42:14 +01:00
Geoffrey White
aa0db1426d Swift: Simplify the QL a bit further. 2023-10-13 17:42:14 +01:00
Geoffrey White
d0f214a9a7 Swift: Widen the model to include things that are not strictly RawRepresentable but which appear similar. This fixes the XXE test cases. Unclear whether xmlParserOption in the test should in fact extend RawRepresentable, or not. 2023-10-13 17:35:05 +01:00
Joe Farebrother
9097d93ac7 Add shared library for filepath normalization 2023-10-13 17:07:47 +01:00
Robert Marsh
b832fc8e32 Swift: additional QLDoc around closures 2023-10-13 14:54:38 +00:00
Mathias Vorreiter Pedersen
140ff537c0 C++: Split 'defaultViableCallable' and 'viableCallable'. 2023-10-13 15:47:02 +01:00
Geoffrey White
4e29ed5ff0 Swift: Model RawRepresentable. 2023-10-13 15:00:49 +01:00
Geoffrey White
228aaee0bf Swift: Add data flow tests for RawRepresentable, OptionSet. 2023-10-13 14:34:05 +01:00
Geoffrey White
9e473ebda4 Swift: Remove the 'rawValue' step as well. 2023-10-13 14:02:15 +01:00
Geoffrey White
da14f428e2 Swift: Remove now redundant additional taint step. from the XXE query. 2023-10-13 13:57:54 +01:00
Calum Grant
192c16bbb3 C++: Format QL and delete note 2023-10-13 13:07:43 +01:00
Geoffrey White
33f83a2089 Swift: Add some failing data flow test cases. 2023-10-13 12:24:43 +01:00
Calum Grant
552221868f C++: Expand ImplicitThisFieldAccess 2023-10-13 12:05:20 +01:00
Tamas Vajk
791a6422b3 C#: Fix params attribute argument extraction 2023-10-13 11:30:02 +02:00
Tamas Vajk
e730815f41 C#: Add test case for params arguments in attributes 2023-10-13 11:29:32 +02:00
Robert Marsh
dd71204128 Swift: update test expectations for for-in locations 2023-10-12 18:59:36 +00:00
Stephan Brandauer
bcde466d6c use of characteristics 2023-10-12 17:22:05 +02:00
Stephan Brandauer
1bbf88f208 Java: basic version of automodel extraction queries 2023-10-12 17:07:46 +02:00
Mathias Vorreiter Pedersen
782ecd77b7 C++: Add change notes. 2023-10-12 11:15:41 +01:00
Mathias Vorreiter Pedersen
6865ce56bc C++: Add an abstract class that can be used to extend 'viableCallable'. 2023-10-12 10:35:36 +01:00
Rasmus Lerchedahl Petersen
a4117538ab Python: update test expectations
This update looks different locally for me,
so this is slightly sketchy..
2023-10-11 16:31:56 +02:00
Robert Marsh
484d020c39 Merge branch 'main' into rdmarsh2/swift/autoclosure-cfg 2023-10-10 18:47:13 +00:00
Robert Marsh
dab9a859f3 Merge branch 'main' into rdmarsh2/swift/autoclosure-cfg 2023-10-09 14:21:28 +00:00
Robert Marsh
30a9656ebb Swift: change note for autoclosure cfg 2023-10-06 20:19:35 +00:00
Robert Marsh
cb749bd973 Swift: CFG for normal autoclosure exprs 2023-10-06 20:14:49 +00:00
Robert Marsh
661da76838 Swift: add function call autoclosure tests 2023-10-06 19:49:33 +00:00
Geoffrey White
9ad1749957 Swift: Hide OpenExistentialExpr from the AST instead. 2023-10-06 17:55:29 +01:00
Geoffrey White
76db1c5c8b Swift: Add the same code to the AST test as well. 2023-10-06 17:13:49 +01:00
Geoffrey White
b0c7964ea6 Swift: Add the same code to the CFG test as well. 2023-10-06 10:07:52 +01:00
Geoffrey White
b3185e9519 Swift: Expand the test case. 2023-10-06 09:43:33 +01:00
Geoffrey White
e225ea6bef Swift: Remove redundant code. 2023-10-05 11:14:54 +01:00
Geoffrey White
dcd88100f0 Swift: Minor corrections, update parse.expected. 2023-10-05 11:11:52 +01:00
Geoffrey White
446416f1ab Swift: Change note. 2023-10-05 11:06:11 +01:00
Geoffrey White
a1512c8af0 Swift: This should always have been private. 2023-10-05 11:06:11 +01:00
Geoffrey White
9bdddabd8a Swift: Avoid changing interfaces we don't need to. Improve QLDoc. 2023-10-05 10:45:59 +01:00
Geoffrey White
fddda0368c Swift: Add PotentialRegexEval / doesEvaluate mechanism. 2023-10-05 10:45:59 +01:00
Geoffrey White
fa10dbea9f Swift: Support mode flags through NSString.CompareOptions. 2023-10-05 10:45:59 +01:00
Geoffrey White
a052a4e385 Swift: Update to a proper data flow config so we can add implicit reads from arrays at the sink. 2023-10-05 10:45:58 +01:00
Geoffrey White
cdc0d1fff1 Swift: Check the options flag contains .regularExpression. 2023-10-05 10:45:58 +01:00
Geoffrey White
fe4ef48844 Swift: Rename some predicates and make them work on dataflow nodes. 2023-10-05 10:26:08 +01:00
Geoffrey White
b5ff104a00 Swift: Naive model for regular expression evaluations through NSString and StringProtocol methods. 2023-10-04 19:19:29 +01:00
Geoffrey White
5263cccefc Swift: Bite the bullet and make 'regex' a non-optional field of the regex test, so that we can be confident where we fail to identify them. 2023-10-04 19:19:28 +01:00
Geoffrey White
24c385b1da Swift: Expand and correct regex tests. 2023-10-04 19:19:28 +01:00
Rasmus Lerchedahl Petersen
177db998c7 Python: add change note 2023-09-29 15:28:08 +02:00
Rasmus Lerchedahl Petersen
ed3ffde5e6 Python: modules are now possibly non-unique
We should consider if this is the right way..
2023-09-29 15:10:19 +02:00
Rasmus Lerchedahl Petersen
be506c64ba Python: update test-expectations
These are semantic differences.
They generally look good, except perhaps
we should exclude illegal package names?
(It passes `legalShortName`, though).
2023-09-29 15:10:19 +02:00
Rasmus Lerchedahl Petersen
4f35a62583 Python: broaden search for imports
This now finds vulnerabilities in
https://github.com/github/field-security-codeql/issues/100
2023-09-29 15:10:19 +02:00
Rasmus Lerchedahl Petersen
d9854eb409 Python: Add QLDoc 2023-09-29 15:10:19 +02:00
Rasmus Lerchedahl Petersen
1d4832cbfe python: allow namespace packages as packages
remove the logic around isPotentialPackage
2023-09-29 15:10:19 +02:00
Rasmus Lerchedahl Petersen
362cf107a4 python: add tests for module import
- `--max-import-depth=3` to give points-to a chance
- `not_root` dir to force namespace package logic
- add usage in `example.py` to get files extracted
2023-09-29 15:10:19 +02:00
Geoffrey White
bb1720d50a Swift: Fix test after merge. 2023-09-27 19:31:04 +01:00
Geoffrey White
936f846b09 Merge branch 'main' into implicitflow 2023-09-27 19:27:07 +01:00
Geoffrey White
0cb00c9091 Swift: Change note. 2023-08-31 15:50:54 +01:00
Geoffrey White
93c39c5fdd Swift: Add data flow through OpenExistentialExpr. 2023-08-31 15:50:32 +01:00
Geoffrey White
b8d29e8fc1 Swift: Add a more realistic test case as well. 2023-08-31 15:46:47 +01:00
Geoffrey White
aeeafd75bf Swift: Add a test for flow through OpenExistentialExpr. 2023-08-31 15:27:18 +01:00
Taus
e5b17af9b5 Java: Fix bad tool output 2023-06-14 12:16:44 +02:00
Taus
b860b21ced Update MaD Declarations after Triage 2023-06-13 16:50:58 +02:00
973 changed files with 43930 additions and 11484 deletions

View File

@@ -25,9 +25,18 @@ updates:
allow:
- dependency-name: "golang.org/x/mod"
- dependency-name: "golang.org/x/tools"
group:
groups:
extractor-dependencies:
patterns:
- "golang.org/x/*"
reviewers:
- "github/codeql-go"
- package-ecosystem: "gomod"
directory: "go/ql/test"
schedule:
interval: "monthly"
ignore:
- dependency-name: "*"
reviewers:
- "github/codeql-go"

View File

@@ -9,26 +9,42 @@ on:
- "*/ql/lib/**/*.ql"
- "*/ql/lib/**/*.qll"
- "*/ql/lib/**/*.yml"
- "shared/**/*.ql"
- "shared/**/*.qll"
- "!**/experimental/**"
- "!ql/**"
- ".github/workflows/check-change-note.yml"
jobs:
check-change-note:
env:
REPO: ${{ github.repository }}
PULL_REQUEST_NUMBER: ${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Fail if no change note found. To fix, either add one, or add the `no-change-note-required` label.
if: |
github.event.pull_request.draft == false &&
!contains(github.event.pull_request.labels.*.name, 'no-change-note-required')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate --jq 'any(.[].filename ; test("/change-notes/.*[.]md$"))' |
grep true -c
change_note_files=$(gh api "repos/$REPO/pulls/$PULL_REQUEST_NUMBER/files" --paginate --jq '.[].filename | select(test("/change-notes/.*[.]md$"))')
if [ -z "$change_note_files" ]; then
echo "No change note found. Either add one, or add the 'no-change-note-required' label."
exit 1
fi
echo "Change notes found:"
echo "$change_note_files"
- name: Fail if the change note filename doesn't match the expected format. The file name must be of the form 'YYYY-MM-DD.md', 'YYYY-MM-DD-{title}.md', where '{title}' is arbitrary text, or released/x.y.z.md for released change-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate --jq '[.[].filename | select(test("/change-notes/.*[.]md$"))] | all(test("/change-notes/[0-9]{4}-[0-9]{2}-[0-9]{2}.*[.]md$") or test("/change-notes/released/[0-9]*[.][0-9]*[.][0-9]*[.]md$"))' |
grep true -c
bad_change_note_file_names=$(gh api "repos/$REPO/pulls/$PULL_REQUEST_NUMBER/files" --paginate --jq '[.[].filename | select(test("/change-notes/.*[.]md$"))][] | select((test("/change-notes/[0-9]{4}-[0-9]{2}-[0-9]{2}.*[.]md$") or test("/change-notes/released/[0-9]*[.][0-9]*[.][0-9]*[.]md$")) | not)')
if [ -n "$bad_change_note_file_names" ]; then
echo "The following change note file names are invalid:"
echo "$bad_change_note_file_names"
exit 1
fi

View File

@@ -91,7 +91,7 @@ jobs:
run: |
# Generate (Asp)NetCore stubs
STUBS_PATH=stubs_output
python3 ql/src/Stubs/make_stubs_nuget.py webapp Swashbuckle.AspNetCore.Swagger 6.5.0 "$STUBS_PATH"
python3 scripts/stubs/make_stubs_nuget.py webapp Swashbuckle.AspNetCore.Swagger 6.5.0 "$STUBS_PATH"
rm -rf ql/test/resources/stubs/_frameworks
# Update existing stubs in the repo with the freshly generated ones
mv "$STUBS_PATH/output/stubs/_frameworks" ql/test/resources/stubs/

View File

@@ -89,9 +89,32 @@ jobs:
- name: Save PR number
run: |
mkdir -p pr
echo ${{ github.event.pull_request.number }} > pr/NR
echo ${PR_NUMBER} > pr/NR
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Upload PR number
uses: actions/upload-artifact@v3
with:
name: pr
path: pr/
- name: Save comment ID (if it exists)
run: |
# Find the latest comment starting with COMMENT_PREFIX
COMMENT_PREFIX=":warning: The head of this PR and the base branch were compared for differences in the framework coverage reports."
COMMENT_ID=$(gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" --paginate | jq --arg prefix "${COMMENT_PREFIX}" 'map(select(.body|startswith($prefix)) | .id) | max // empty')
if [[ -z ${COMMENT_ID} ]]
then
echo "Comment not found. Not uploading 'comment/ID' artifact."
else
mkdir -p comment
echo ${COMMENT_ID} > comment/ID
fi
env:
GITHUB_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Upload comment ID (if it exists)
uses: actions/upload-artifact@v3
with:
name: comment
path: comment/
if-no-files-found: ignore

View File

@@ -6,7 +6,7 @@ provide:
- "*/ql/consistency-queries/qlpack.yml"
- "*/ql/automodel/src/qlpack.yml"
- "*/ql/automodel/test/qlpack.yml"
- "shared/*/qlpack.yml"
- "shared/**/qlpack.yml"
- "cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/qlpack.yml"
- "go/ql/config/legacy-support/qlpack.yml"
- "go/build/codeql-extractor-go/codeql-extractor.yml"

View File

@@ -0,0 +1,19 @@
class BuiltinType extends @builtintype {
string toString() { none() }
}
from BuiltinType type, string name, int kind, int kind_new, int size, int sign, int alignment
where
builtintypes(type, name, kind, size, sign, alignment) and
if
type instanceof @fp16 or
type instanceof @std_bfloat16 or
type instanceof @std_float16 or
type instanceof @complex_std_float32 or
type instanceof @complex_float32x or
type instanceof @complex_std_float64 or
type instanceof @complex_float64x or
type instanceof @complex_std_float128
then kind_new = 2
else kind_new = kind
select type, name, kind_new, size, sign, alignment

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
description: Introduce new floating-point types from C23 and C++23
compatibility: backwards
builtintypes.rel: run builtintypes.qlo

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
description: Introduce extractor version numbers
compatibility: breaking
extractor_version.rel: delete

View File

@@ -1,3 +1,18 @@
## 0.11.0
### Breaking Changes
* The `Container` and `Folder` classes now derive from `ElementBase` instead of `Locatable`, and no longer expose the `getLocation` predicate. Use `getURL` instead.
### New Features
* Added a new class `AdditionalCallTarget` for specifying additional call targets.
### Minor Analysis Improvements
* More field accesses are identified as `ImplicitThisFieldAccess`.
* Added support for new floating-point types in C23 and C++23.
## 0.10.1
### Minor Analysis Improvements

View File

@@ -0,0 +1,14 @@
## 0.11.0
### Breaking Changes
* The `Container` and `Folder` classes now derive from `ElementBase` instead of `Locatable`, and no longer expose the `getLocation` predicate. Use `getURL` instead.
### New Features
* Added a new class `AdditionalCallTarget` for specifying additional call targets.
### Minor Analysis Improvements
* More field accesses are identified as `ImplicitThisFieldAccess`.
* Added support for new floating-point types in C23 and C++23.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.10.1
lastReleaseVersion: 0.11.0

View File

@@ -1,5 +1,5 @@
name: codeql/cpp-all
version: 0.10.1
version: 0.11.0
groups: cpp
dbscheme: semmlecode.cpp.dbscheme
extractor: cpp
@@ -7,6 +7,7 @@ library: true
upgrades: upgrades
dependencies:
codeql/dataflow: ${workspace}
codeql/rangeanalysis: ${workspace}
codeql/ssa: ${workspace}
codeql/tutorial: ${workspace}
codeql/util: ${workspace}

View File

@@ -32,7 +32,7 @@ private module Input implements InputSig {
private module Impl = Make<Input>;
/** A file or folder. */
class Container extends Locatable, Impl::Container {
class Container extends ElementBase, Impl::Container {
override string toString() { result = Impl::Container.super.toString() }
}
@@ -47,11 +47,6 @@ class Container extends Locatable, Impl::Container {
* To get the full path, use `getAbsolutePath`.
*/
class Folder extends Container, Impl::Folder {
override Location getLocation() {
result.getContainer() = this and
result.hasLocationInfo(_, 0, 0, 0, 0)
}
override string getAPrimaryQlClass() { result = "Folder" }
}
@@ -67,7 +62,7 @@ class Folder extends Container, Impl::Folder {
* The base name further decomposes into the _stem_ and _extension_ -- see
* `getStem` and `getExtension`. To get the full path, use `getAbsolutePath`.
*/
class File extends Container, Impl::File {
class File extends Container, Locatable, Impl::File {
override string getAPrimaryQlClass() { result = "File" }
override Location getLocation() {

View File

@@ -819,6 +819,30 @@ private predicate floatingPointTypeMapping(
or
// _Complex _Float16
kind = 53 and base = 2 and domain = TComplexDomain() and realKind = 52 and extended = false
or
// __fp16
kind = 54 and base = 2 and domain = TRealDomain() and realKind = 54 and extended = false
or
// __bf16
kind = 55 and base = 2 and domain = TRealDomain() and realKind = 55 and extended = false
or
// std::float16_t
kind = 56 and base = 2 and domain = TRealDomain() and realKind = 56 and extended = false
or
// _Complex _Float32
kind = 57 and base = 2 and domain = TComplexDomain() and realKind = 45 and extended = false
or
// _Complex _Float32x
kind = 58 and base = 2 and domain = TComplexDomain() and realKind = 46 and extended = true
or
// _Complex _Float64
kind = 59 and base = 2 and domain = TComplexDomain() and realKind = 47 and extended = false
or
// _Complex _Float64x
kind = 60 and base = 2 and domain = TComplexDomain() and realKind = 48 and extended = true
or
// _Complex _Float128
kind = 61 and base = 2 and domain = TComplexDomain() and realKind = 49 and extended = false
}
/**

View File

@@ -306,15 +306,13 @@ private predicate exprHasReferenceConversion(Expr e) { referenceConversion(e.get
* }
* };
* ```
* Note: the C++ front-end often automatically desugars `field` to
* `this->field`, so most accesses of `this->field` are instances
* of `PointerFieldAccess` (with `ThisExpr` as the qualifier), not
* `ImplicitThisFieldAccess`.
*/
class ImplicitThisFieldAccess extends FieldAccess {
override string getAPrimaryQlClass() { result = "ImplicitThisFieldAccess" }
ImplicitThisFieldAccess() { not exists(this.getQualifier()) }
ImplicitThisFieldAccess() {
this.getQualifier().(ThisExpr).isCompilerGenerated() or not exists(this.getQualifier())
}
}
/**
@@ -332,7 +330,7 @@ class PointerToFieldLiteral extends ImplicitThisFieldAccess {
// access without a qualifier. The only other unqualified field accesses it
// emits are for compiler-generated constructors and destructors. When we
// filter those out, there are only pointer-to-field literals left.
not this.isCompilerGenerated()
not this.isCompilerGenerated() and not exists(this.getQualifier())
}
override predicate isConstant() { any() }

View File

@@ -0,0 +1,15 @@
/**
* INTERNAL: Do not use. Provides predicates for getting the CodeQL and frontend
* version used during database extraction.
*/
/** Get the extractor CodeQL version */
string getExtractorCodeQLVersion() { extractor_version(result, _) }
/** Get the extractor frontend version */
string getExtractorFrontendVersion() { extractor_version(_, result) }
predicate isExtractorFrontendVersion65OrHigher() {
// Version numbers we not included in the database before 6.5.
exists(getExtractorCodeQLVersion())
}

View File

@@ -7,9 +7,12 @@ private import DataFlowImplCommon as DataFlowImplCommon
/**
* Gets a function that might be called by `call`.
*
* This predicate does not take additional call targets
* from `AdditionalCallTarget` into account.
*/
cached
DataFlowCallable viableCallable(DataFlowCall call) {
DataFlowCallable defaultViableCallable(DataFlowCall call) {
DataFlowImplCommon::forceCachingInSameStage() and
result = call.getStaticCallTarget()
or
@@ -29,6 +32,17 @@ DataFlowCallable viableCallable(DataFlowCall call) {
result = call.(VirtualDispatch::DataSensitiveCall).resolve()
}
/**
* Gets a function that might be called by `call`.
*/
cached
DataFlowCallable viableCallable(DataFlowCall call) {
result = defaultViableCallable(call)
or
// Additional call targets
result = any(AdditionalCallTarget additional).viableTarget(call.getUnconvertedResultExpression())
}
/**
* Provides virtual dispatch support compatible with the original
* implementation of `semmle.code.cpp.security.TaintTracking`.

View File

@@ -14,6 +14,7 @@ private import DataFlowPrivate
private import ModelUtil
private import SsaInternals as Ssa
private import DataFlowImplCommon as DataFlowImplCommon
private import codeql.util.Unit
/**
* The IR dataflow graph consists of the following nodes:
@@ -2237,3 +2238,43 @@ module InstructionBarrierGuard<instructionGuardChecksSig/3 instructionGuardCheck
)
}
}
/**
* A unit class for adding additional call steps.
*
* Extend this class to add additional call steps to the data flow graph.
*
* For example, if the following subclass is added:
* ```ql
* class MyAdditionalCallTarget extends DataFlow::AdditionalCallTarget {
* override Function viableTarget(Call call) {
* call.getTarget().hasName("f") and
* result.hasName("g")
* }
* }
* ```
* then flow from `source()` to `x` in `sink(x)` is reported in the following example:
* ```cpp
* void sink(int);
* int source();
* void f(int);
*
* void g(int x) {
* sink(x);
* }
*
* void test() {
* int x = source();
* f(x);
* }
* ```
*
* Note: To prevent reevaluation of cached dataflow-related predicates any
* subclass of `AdditionalCallTarget` must be imported in all dataflow queries.
*/
class AdditionalCallTarget extends Unit {
/**
* Gets a viable target for `call`.
*/
abstract DataFlowCallable viableTarget(Call call);
}

View File

@@ -31,26 +31,35 @@ DataFlow::Node callInput(CallInstruction call, FunctionInput input) {
)
}
/**
* Gets the node that represents the output of `call` with kind `output` at
* indirection index `indirectionIndex`.
*/
private Node callOutputWithIndirectionIndex(
CallInstruction call, FunctionOutput output, int indirectionIndex
) {
// The return value
simpleOutNode(result, call) and
output.isReturnValue() and
indirectionIndex = 0
or
// The side effect of a call on the value pointed to by an argument or qualifier
exists(int index |
result.(IndirectArgumentOutNode).getArgumentIndex() = index and
result.(IndirectArgumentOutNode).getIndirectionIndex() = indirectionIndex - 1 and
result.(IndirectArgumentOutNode).getCallInstruction() = call and
output.isParameterDerefOrQualifierObject(index, indirectionIndex - 1)
)
or
result = getIndirectReturnOutNode(call, indirectionIndex) and
output.isReturnValueDeref(indirectionIndex)
}
/**
* Gets the instruction that holds the `output` for `call`.
*/
Node callOutput(CallInstruction call, FunctionOutput output) {
// The return value
simpleOutNode(result, call) and
output.isReturnValue()
or
// The side effect of a call on the value pointed to by an argument or qualifier
exists(int index, int indirectionIndex |
result.(IndirectArgumentOutNode).getArgumentIndex() = index and
result.(IndirectArgumentOutNode).getIndirectionIndex() = indirectionIndex and
result.(IndirectArgumentOutNode).getCallInstruction() = call and
output.isParameterDerefOrQualifierObject(index, indirectionIndex)
)
or
exists(int ind |
result = getIndirectReturnOutNode(call, ind) and
output.isReturnValueDeref(ind)
)
result = callOutputWithIndirectionIndex(call, output, _)
}
DataFlow::Node callInput(CallInstruction call, FunctionInput input, int d) {
@@ -76,19 +85,15 @@ private IndirectReturnOutNode getIndirectReturnOutNode(CallInstruction call, int
*/
bindingset[d]
Node callOutput(CallInstruction call, FunctionOutput output, int d) {
exists(DataFlow::Node n | n = callOutput(call, output) and d > 0 |
exists(DataFlow::Node n, int indirectionIndex |
n = callOutputWithIndirectionIndex(call, output, indirectionIndex) and d > 0
|
// The return value
result = getIndirectReturnOutNode(n.asInstruction(), d)
result = callOutputWithIndirectionIndex(call, output, indirectionIndex + d)
or
// If there isn't an indirect out node for the call with indirection `d` then
// we conflate this with the underlying `CallInstruction`.
not exists(getIndirectReturnOutNode(call, d)) and
not exists(getIndirectReturnOutNode(call, indirectionIndex + d)) and
n = result
or
// The side effect of a call on the value pointed to by an argument or qualifier
exists(Operand operand, int indirectionIndex |
Ssa::outNodeHasAddressAndIndex(n, operand, indirectionIndex) and
Ssa::outNodeHasAddressAndIndex(result, operand, indirectionIndex + d)
)
)
}

View File

@@ -228,7 +228,7 @@ private class PointerWrapperTypeIndirection extends Indirection instanceof Point
override predicate isAdditionalDereference(Instruction deref, Operand address) {
exists(CallInstruction call |
operandForFullyConvertedCall(getAUse(deref), call) and
this = call.getStaticCallTarget().getClassAndName("operator*") and
this = call.getStaticCallTarget().getClassAndName(["operator*", "operator->", "get"]) and
address = call.getThisArgumentOperand()
)
}

View File

@@ -1,5 +1,6 @@
private import cpp
import semmle.code.cpp.ir.implementation.raw.IR
private import semmle.code.cpp.internal.ExtractorVersion
private import semmle.code.cpp.ir.IRConfiguration
private import semmle.code.cpp.ir.implementation.Opcode
private import semmle.code.cpp.ir.implementation.internal.OperandTag
@@ -361,6 +362,12 @@ predicate ignoreLoad(Expr expr) {
or
expr instanceof FunctionAccess
or
// The load is duplicated from the operand.
isExtractorFrontendVersion65OrHigher() and expr instanceof ParenthesisExpr
or
// The load is duplicated from the right operand.
isExtractorFrontendVersion65OrHigher() and expr instanceof CommaExpr
or
expr.(PointerDereferenceExpr).getOperand().getFullyConverted().getType().getUnspecifiedType()
instanceof FunctionPointerType
or

View File

@@ -1,4 +1,5 @@
private import cpp
private import semmle.code.cpp.internal.ExtractorVersion
private import semmle.code.cpp.ir.implementation.IRType
private import semmle.code.cpp.ir.implementation.Opcode
private import semmle.code.cpp.ir.implementation.internal.OperandTag
@@ -649,7 +650,9 @@ class TranslatedPrefixCrementOperation extends TranslatedCrementOperation {
override PrefixCrementOperation expr;
override Instruction getResult() {
if expr.isPRValueCategory()
// The following distinction is needed to work around extractor limitations
// in old versions of the extractor.
if expr.isPRValueCategory() and not isExtractorFrontendVersion65OrHigher()
then
// If this is C, then the result of a prefix crement is a prvalue for the
// new value assigned to the operand. If this is C++, then the result is
@@ -1504,7 +1507,9 @@ class TranslatedAssignExpr extends TranslatedNonConstantExpr {
}
final override Instruction getResult() {
if expr.isPRValueCategory()
// The following distinction is needed to work around extractor limitations
// in old versions of the extractor.
if expr.isPRValueCategory() and not isExtractorFrontendVersion65OrHigher()
then
// If this is C, then the result of an assignment is a prvalue for the new
// value assigned to the left operand. If this is C++, then the result is
@@ -1642,7 +1647,9 @@ class TranslatedAssignOperation extends TranslatedNonConstantExpr {
}
final override Instruction getResult() {
if expr.isPRValueCategory()
// The following distinction is needed to work around extractor limitations
// in old versions of the extractor.
if expr.isPRValueCategory() and not isExtractorFrontendVersion65OrHigher()
then
// If this is C, then the result of an assignment is a prvalue for the new
// value assigned to the left operand. If this is C++, then the result is
@@ -2191,8 +2198,16 @@ abstract class TranslatedConditionalExpr extends TranslatedNonConstantExpr {
not this.elseIsVoid() and tag = ConditionValueFalseStoreTag()
) and
opcode instanceof Opcode::Store and
resultType = this.getResultType()
if isExtractorFrontendVersion65OrHigher()
then
not expr.hasLValueToRValueConversion() and
resultType = this.getResultType()
or
expr.hasLValueToRValueConversion() and
resultType = getTypeForPRValue(expr.getType())
else resultType = this.getResultType()
or
(not expr.hasLValueToRValueConversion() or not isExtractorFrontendVersion65OrHigher()) and
tag = ConditionValueResultLoadTag() and
opcode instanceof Opcode::Load and
resultType = this.getResultType()
@@ -2222,8 +2237,16 @@ abstract class TranslatedConditionalExpr extends TranslatedNonConstantExpr {
)
or
tag = ConditionValueResultTempAddressTag() and
result = this.getInstruction(ConditionValueResultLoadTag())
if isExtractorFrontendVersion65OrHigher()
then
not expr.hasLValueToRValueConversion() and
result = this.getInstruction(ConditionValueResultLoadTag())
or
expr.hasLValueToRValueConversion() and
result = this.getParent().getChildSuccessor(this)
else result = this.getInstruction(ConditionValueResultLoadTag())
or
(not expr.hasLValueToRValueConversion() or not isExtractorFrontendVersion65OrHigher()) and
tag = ConditionValueResultLoadTag() and
result = this.getParent().getChildSuccessor(this)
)
@@ -2252,18 +2275,24 @@ abstract class TranslatedConditionalExpr extends TranslatedNonConstantExpr {
result = this.getElse().getResult()
)
or
(not expr.hasLValueToRValueConversion() or not isExtractorFrontendVersion65OrHigher()) and
tag = ConditionValueResultLoadTag() and
(
operandTag instanceof AddressOperandTag and
result = this.getInstruction(ConditionValueResultTempAddressTag())
)
operandTag instanceof AddressOperandTag and
result = this.getInstruction(ConditionValueResultTempAddressTag())
)
}
final override predicate hasTempVariable(TempVariableTag tag, CppType type) {
not this.resultIsVoid() and
tag = ConditionValueTempVar() and
type = this.getResultType()
if isExtractorFrontendVersion65OrHigher()
then
not expr.hasLValueToRValueConversion() and
type = this.getResultType()
or
expr.hasLValueToRValueConversion() and
type = getTypeForPRValue(expr.getType())
else type = this.getResultType()
}
final override IRVariable getInstructionVariable(InstructionTag tag) {
@@ -2278,7 +2307,14 @@ abstract class TranslatedConditionalExpr extends TranslatedNonConstantExpr {
final override Instruction getResult() {
not this.resultIsVoid() and
result = this.getInstruction(ConditionValueResultLoadTag())
if isExtractorFrontendVersion65OrHigher()
then
expr.hasLValueToRValueConversion() and
result = this.getInstruction(ConditionValueResultTempAddressTag())
or
not expr.hasLValueToRValueConversion() and
result = this.getInstruction(ConditionValueResultLoadTag())
else result = this.getInstruction(ConditionValueResultLoadTag())
}
override Instruction getChildSuccessor(TranslatedElement child) {
@@ -3238,10 +3274,18 @@ predicate exprNeedsCopyIfNotLoaded(Expr expr) {
expr instanceof AssignExpr
or
expr instanceof AssignOperation and
not expr.isPRValueCategory() // is C++
(
not expr.isPRValueCategory() // is C++
or
isExtractorFrontendVersion65OrHigher()
)
or
expr instanceof PrefixCrementOperation and
not expr.isPRValueCategory() // is C++
(
not expr.isPRValueCategory() // is C++
or
isExtractorFrontendVersion65OrHigher()
)
or
// Because the load is on the `e` in `e++`.
expr instanceof PostfixCrementOperation

View File

@@ -19,6 +19,7 @@ private import implementations.Strtok
private import implementations.Strset
private import implementations.Strcrement
private import implementations.Strnextc
private import implementations.Strtol
private import implementations.StdContainer
private import implementations.StdPair
private import implementations.StdMap

View File

@@ -13,7 +13,7 @@ private class PureStrFunction extends AliasFunction, ArrayFunction, TaintFunctio
PureStrFunction() {
this.hasGlobalOrStdOrBslName([
atoi(), "strcasestr", "strchnul", "strchr", "strchrnul", "strstr", "strpbrk", "strrchr",
"strspn", strtol(), strrev(), strcmp(), strlwr(), strupr()
"strspn", strrev(), strcmp(), strlwr(), strupr()
])
}
@@ -70,8 +70,6 @@ private class PureStrFunction extends AliasFunction, ArrayFunction, TaintFunctio
private string atoi() { result = ["atof", "atoi", "atol", "atoll"] }
private string strtol() { result = ["strtod", "strtof", "strtol", "strtoll", "strtoq", "strtoul"] }
private string strlwr() {
result = ["_strlwr", "_wcslwr", "_mbslwr", "_strlwr_l", "_wcslwr_l", "_mbslwr_l"]
}

View File

@@ -32,6 +32,8 @@ private class Strtok extends ArrayFunction, AliasFunction, TaintFunction, SideEf
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
input.isParameter(0) and output.isReturnValue()
or
input.isParameterDeref(0) and output.isReturnValueDeref()
}
override predicate hasOnlySpecificReadSideEffects() { none() }

View File

@@ -0,0 +1,54 @@
import semmle.code.cpp.models.interfaces.ArrayFunction
import semmle.code.cpp.models.interfaces.Taint
import semmle.code.cpp.models.interfaces.Alias
import semmle.code.cpp.models.interfaces.SideEffect
private string strtol() { result = ["strtod", "strtof", "strtol", "strtoll", "strtoq", "strtoul"] }
/**
* The standard function `strtol` and its assorted variants
*/
private class Strtol extends AliasFunction, ArrayFunction, TaintFunction, SideEffectFunction {
Strtol() { this.hasGlobalOrStdOrBslName(strtol()) }
override predicate hasArrayInput(int bufParam) {
// All the functions given by `strtol()` takes a `const char*` input as the first parameter
bufParam = 0
}
override predicate hasArrayWithNullTerminator(int bufParam) { bufParam = 0 }
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
(
input.isParameter(0)
or
input.isParameterDeref(0)
) and
output.isReturnValue()
or
input.isParameter(0) and
output.isParameterDeref(1)
}
override predicate parameterNeverEscapes(int i) {
// Parameter 0 does escape into parameter 1.
i = 1
}
override predicate parameterEscapesOnlyViaReturn(int i) { none() }
override predicate parameterIsAlwaysReturned(int i) { none() }
override predicate hasOnlySpecificReadSideEffects() { any() }
override predicate hasOnlySpecificWriteSideEffects() { any() }
override predicate hasSpecificReadSideEffect(ParameterIndex i, boolean buffer) {
i = 0 and
buffer = true
}
override predicate hasSpecificWriteSideEffect(ParameterIndex i, boolean buffer, boolean mustWrite) {
i = 1 and buffer = false and mustWrite = false
}
}

View File

@@ -8,6 +8,18 @@ class SemLocation instanceof Location {
*/
string toString() { result = super.toString() }
/** Gets the 1-based line number (inclusive) where this location starts. */
int getStartLine() { result = super.getStartLine() }
/** Gets the 1-based column number (inclusive) where this location starts. */
int getStartColumn() { result = super.getStartColumn() }
/** Gets the 1-based line number (inclusive) where this location ends. */
int getEndLine() { result = super.getEndLine() }
/** Gets the 1-based column number (inclusive) where this location ends. */
int getEndColumn() { result = super.getEndColumn() }
/**
* Holds if this element is at the specified location.
* The location spans column `startcolumn` of line `startline` to

View File

@@ -1,5 +1,7 @@
private import RangeAnalysisStage
private import RangeAnalysisImpl
private import codeql.rangeanalysis.RangeAnalysis
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticExpr
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticType
module FloatDelta implements DeltaSig {
class Delta = float;
@@ -20,7 +22,7 @@ module FloatDelta implements DeltaSig {
Delta fromFloat(float f) { result = f }
}
module FloatOverflow implements OverflowSig<FloatDelta> {
module FloatOverflow implements OverflowSig<Sem, FloatDelta> {
predicate semExprDoesNotOverflow(boolean positively, SemExpr expr) {
exists(float lb, float ub, float delta |
typeBounds(expr.getSemType(), lb, ub) and

View File

@@ -1,29 +0,0 @@
private import RangeAnalysisStage
module IntDelta implements DeltaSig {
class Delta = int;
bindingset[d]
bindingset[result]
float toFloat(Delta d) { result = d }
bindingset[d]
bindingset[result]
int toInt(Delta d) { result = d }
bindingset[n]
bindingset[result]
Delta fromInt(int n) { result = n }
bindingset[f]
Delta fromFloat(float f) {
result =
min(float diff, float res |
diff = (res - f) and res = f.ceil()
or
diff = (f - res) and res = f.floor()
|
res order by diff
)
}
}

View File

@@ -12,11 +12,13 @@
private import ModulusAnalysisSpecific::Private
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.Semantic
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticLocation
private import ConstantAnalysis
private import RangeUtils
private import RangeAnalysisStage
private import codeql.rangeanalysis.RangeAnalysis
private import RangeAnalysisImpl
module ModulusAnalysis<DeltaSig D, BoundSig<D> Bounds, UtilSig<D> U> {
module ModulusAnalysis<DeltaSig D, BoundSig<SemLocation, Sem, D> Bounds, UtilSig<Sem, D> U> {
pragma[nomagic]
private predicate valueFlowStepSsaEqFlowCond(
SemSsaReadPosition pos, SemSsaVariable v, SemExpr e, int delta

View File

@@ -3,10 +3,11 @@
*/
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.Semantic
private import RangeAnalysisStage
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.analysis.FloatDelta
private import RangeAnalysisImpl
private import codeql.rangeanalysis.RangeAnalysis
module CppLangImplConstant implements LangSig<FloatDelta> {
module CppLangImplConstant implements LangSig<Sem, FloatDelta> {
/**
* Holds if the specified expression should be excluded from the result of `ssaRead()`.
*

View File

@@ -1,13 +1,104 @@
private import RangeAnalysisStage
private import RangeAnalysisConstantSpecific
private import RangeAnalysisRelativeSpecific
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.analysis.FloatDelta
private import RangeUtils
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticExpr
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticCFG
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticGuard
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticBound as SemanticBound
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticLocation
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticSSA
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticType as SemanticType
private import SemanticType
private import codeql.rangeanalysis.RangeAnalysis
private import ConstantAnalysis as ConstantAnalysis
module ConstantBounds implements BoundSig<FloatDelta> {
module Sem implements Semantic {
class Expr = SemExpr;
class ConstantIntegerExpr = ConstantAnalysis::SemConstantIntegerExpr;
class BinaryExpr = SemBinaryExpr;
class AddExpr = SemAddExpr;
class SubExpr = SemSubExpr;
class MulExpr = SemMulExpr;
class DivExpr = SemDivExpr;
class RemExpr = SemRemExpr;
class BitAndExpr = SemBitAndExpr;
class BitOrExpr = SemBitOrExpr;
class ShiftLeftExpr = SemShiftLeftExpr;
class ShiftRightExpr = SemShiftRightExpr;
class ShiftRightUnsignedExpr = SemShiftRightUnsignedExpr;
class RelationalExpr = SemRelationalExpr;
class UnaryExpr = SemUnaryExpr;
class ConvertExpr = SemConvertExpr;
class BoxExpr = SemBoxExpr;
class UnboxExpr = SemUnboxExpr;
class NegateExpr = SemNegateExpr;
class AddOneExpr = SemAddOneExpr;
class SubOneExpr = SemSubOneExpr;
class ConditionalExpr = SemConditionalExpr;
class BasicBlock = SemBasicBlock;
class Guard = SemGuard;
predicate implies_v2 = semImplies_v2/4;
predicate guardDirectlyControlsSsaRead = semGuardDirectlyControlsSsaRead/3;
class Type = SemType;
class IntegerType = SemIntegerType;
class FloatingPointType = SemFloatingPointType;
class AddressType = SemAddressType;
class SsaVariable = SemSsaVariable;
class SsaPhiNode = SemSsaPhiNode;
class SsaExplicitUpdate = SemSsaExplicitUpdate;
class SsaReadPosition = SemSsaReadPosition;
class SsaReadPositionPhiInputEdge = SemSsaReadPositionPhiInputEdge;
class SsaReadPositionBlock = SemSsaReadPositionBlock;
predicate backEdge = semBackEdge/3;
predicate conversionCannotOverflow(Type fromType, Type toType) {
SemanticType::conversionCannotOverflow(fromType, toType)
}
}
module SignAnalysis implements SignAnalysisSig<Sem> {
private import SignAnalysisCommon as SA
import SA::SignAnalysis<FloatDelta, Util>
}
module ConstantBounds implements BoundSig<SemLocation, Sem, FloatDelta> {
class SemBound instanceof SemanticBound::SemBound {
SemBound() {
this instanceof SemanticBound::SemZeroBound
@@ -29,7 +120,7 @@ module ConstantBounds implements BoundSig<FloatDelta> {
}
}
module RelativeBounds implements BoundSig<FloatDelta> {
module RelativeBounds implements BoundSig<SemLocation, Sem, FloatDelta> {
class SemBound instanceof SemanticBound::SemBound {
SemBound() { not this instanceof SemanticBound::SemZeroBound }
@@ -47,13 +138,38 @@ module RelativeBounds implements BoundSig<FloatDelta> {
}
}
module AllBounds implements BoundSig<SemLocation, Sem, FloatDelta> {
class SemBound instanceof SemanticBound::SemBound {
string toString() { result = super.toString() }
SemLocation getLocation() { result = super.getLocation() }
SemExpr getExpr(float delta) { result = super.getExpr(delta) }
}
class SemZeroBound extends SemBound instanceof SemanticBound::SemZeroBound { }
class SemSsaBound extends SemBound instanceof SemanticBound::SemSsaBound {
SemSsaVariable getAVariable() { result = this.(SemanticBound::SemSsaBound).getAVariable() }
}
}
private module ModulusAnalysisInstantiated implements ModulusAnalysisSig<Sem> {
class ModBound = AllBounds::SemBound;
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.analysis.ModulusAnalysis as MA
import MA::ModulusAnalysis<FloatDelta, AllBounds, Util>
}
module Util = RangeUtil<FloatDelta, CppLangImplConstant>;
module ConstantStage =
RangeStage<FloatDelta, ConstantBounds, FloatOverflow, CppLangImplConstant,
RangeUtil<FloatDelta, CppLangImplConstant>>;
RangeStage<SemLocation, Sem, FloatDelta, ConstantBounds, FloatOverflow, CppLangImplConstant,
SignAnalysis, ModulusAnalysisInstantiated, Util>;
module RelativeStage =
RangeStage<FloatDelta, RelativeBounds, FloatOverflow, CppLangImplRelative,
RangeUtil<FloatDelta, CppLangImplRelative>>;
RangeStage<SemLocation, Sem, FloatDelta, RelativeBounds, FloatOverflow, CppLangImplRelative,
SignAnalysis, ModulusAnalysisInstantiated, Util>;
private newtype TSemReason =
TSemNoReason() or

View File

@@ -3,13 +3,12 @@
*/
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.Semantic
private import RangeAnalysisStage
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.analysis.FloatDelta
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.analysis.IntDelta
private import RangeAnalysisImpl
private import semmle.code.cpp.rangeanalysis.RangeAnalysisUtils
private import codeql.rangeanalysis.RangeAnalysis
module CppLangImplRelative implements LangSig<FloatDelta> {
module CppLangImplRelative implements LangSig<Sem, FloatDelta> {
/**
* Holds if the specified expression should be excluded from the result of `ssaRead()`.
*

View File

@@ -4,10 +4,11 @@
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.Semantic
private import RangeAnalysisRelativeSpecific
private import RangeAnalysisStage as Range
private import codeql.rangeanalysis.RangeAnalysis
private import RangeAnalysisImpl
private import ConstantAnalysis
module RangeUtil<Range::DeltaSig D, Range::LangSig<D> Lang> implements Range::UtilSig<D> {
module RangeUtil<DeltaSig D, LangSig<Sem, D> Lang> implements UtilSig<Sem, D> {
/**
* Gets an expression that equals `v - d`.
*/
@@ -138,27 +139,33 @@ module RangeUtil<Range::DeltaSig D, Range::LangSig<D> Lang> implements Range::Ut
or
not exists(Lang::getAlternateTypeForSsaVariable(var)) and result = var.getType()
}
import Ranking
}
/**
* Holds if `rix` is the number of input edges to `phi`.
*/
predicate maxPhiInputRank(SemSsaPhiNode phi, int rix) {
rix = max(int r | rankedPhiInput(phi, _, _, r))
}
import Ranking
/**
* Holds if `inp` is an input to `phi` along `edge` and this input has index `r`
* in an arbitrary 1-based numbering of the input edges to `phi`.
*/
predicate rankedPhiInput(
SemSsaPhiNode phi, SemSsaVariable inp, SemSsaReadPositionPhiInputEdge edge, int r
) {
edge.phiInput(phi, inp) and
edge =
rank[r](SemSsaReadPositionPhiInputEdge e |
e.phiInput(phi, _)
|
e order by e.getOrigBlock().getUniqueId()
)
module Ranking {
/**
* Holds if `rix` is the number of input edges to `phi`.
*/
predicate maxPhiInputRank(SemSsaPhiNode phi, int rix) {
rix = max(int r | rankedPhiInput(phi, _, _, r))
}
/**
* Holds if `inp` is an input to `phi` along `edge` and this input has index `r`
* in an arbitrary 1-based numbering of the input edges to `phi`.
*/
predicate rankedPhiInput(
SemSsaPhiNode phi, SemSsaVariable inp, SemSsaReadPositionPhiInputEdge edge, int r
) {
edge.phiInput(phi, inp) and
edge =
rank[r](SemSsaReadPositionPhiInputEdge e |
e.phiInput(phi, _)
|
e order by e.getOrigBlock().getUniqueId()
)
}
}

View File

@@ -6,14 +6,15 @@
* three-valued domain `{negative, zero, positive}`.
*/
private import RangeAnalysisStage
private import codeql.rangeanalysis.RangeAnalysis
private import RangeAnalysisImpl
private import SignAnalysisSpecific as Specific
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.Semantic
private import ConstantAnalysis
private import RangeUtils
private import Sign
module SignAnalysis<DeltaSig D, UtilSig<D> Utils> {
module SignAnalysis<DeltaSig D, UtilSig<Sem, D> Utils> {
/**
* An SSA definition for which the analysis can compute the sign.
*
@@ -507,4 +508,16 @@ module SignAnalysis<DeltaSig D, UtilSig<D> Utils> {
not semExprSign(e) = TPos() and
not semExprSign(e) = TZero()
}
/**
* Holds if `e` may have positive values. This does not rule out the
* possibility for negative values.
*/
predicate semMayBePositive(SemExpr e) { semExprSign(e) = TPos() }
/**
* Holds if `e` may have negative values. This does not rule out the
* possibility for positive values.
*/
predicate semMayBeNegative(SemExpr e) { semExprSign(e) = TNeg() }
}

View File

@@ -372,7 +372,8 @@ private predicate analyzablePointerFieldAccess(PointerFieldAccess access) {
private predicate mk_PointerFieldAccess(HashCons qualifier, Field target, PointerFieldAccess access) {
analyzablePointerFieldAccess(access) and
target = access.getTarget() and
qualifier = hashCons(access.getQualifier().getFullyConverted())
qualifier = hashCons(access.getQualifier().getFullyConverted()) and
not access instanceof ImplicitThisFieldAccess
}
private predicate analyzableImplicitThisFieldAccess(ImplicitThisFieldAccess access) {

View File

@@ -197,6 +197,11 @@ svnchurn(
* C++ dbscheme
*/
extractor_version(
string codeql_version: string ref,
string frontend_version: string ref
)
@location = @location_stmt | @location_expr | @location_default ;
/**
@@ -612,6 +617,14 @@ case @builtintype.kind of
| 51 = @char8_t
| 52 = @float16 // _Float16
| 53 = @complex_float16 // _Complex _Float16
| 54 = @fp16 // __fp16
| 55 = @std_bfloat16 // __bf16
| 56 = @std_float16 // std::float16_t
| 57 = @complex_std_float32 // _Complex _Float32
| 58 = @complex_float32x // _Complex _Float32x
| 59 = @complex_std_float64 // _Complex _Float64
| 60 = @complex_float64x // _Complex _Float64x
| 61 = @complex_std_float128 // _Complex _Float128
;
builtintypes(

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Introduce extractor version numbers
compatibility: full

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Introduce new floating-point types from C23 and C++23
compatibility: full

View File

@@ -1,3 +1,7 @@
## 0.8.2
No user-facing changes.
## 0.8.1
### New Queries

View File

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

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.8.1
lastReleaseVersion: 0.8.2

View File

@@ -1,5 +1,5 @@
name: codeql/cpp-queries
version: 0.8.1
version: 0.8.2
groups:
- cpp
- queries

View File

@@ -763,7 +763,7 @@ StaticMemberAccess.cpp:
# 7| ValueCategory = lvalue
# 7| getRValue(): [VariableAccess] i
# 7| Type = [IntType] int
# 7| ValueCategory = prvalue
# 7| ValueCategory = prvalue(load)
# 7| getQualifier(): [VariableAccess] xref
# 7| Type = [LValueReferenceType] X &
# 7| ValueCategory = prvalue(load)
@@ -1298,7 +1298,7 @@ union_etc.cpp:
# 6| getExpr(): [AssignExpr] ... = ...
# 6| Type = [IntType] int
# 6| ValueCategory = lvalue
# 6| getLValue(): [PointerFieldAccess] x
# 6| getLValue(): [ImplicitThisFieldAccess,PointerFieldAccess] x
# 6| Type = [IntType] int
# 6| ValueCategory = lvalue
# 6| getQualifier(): [ThisExpr] this
@@ -1394,7 +1394,7 @@ union_etc.cpp:
# 26| ValueCategory = lvalue
# 26| getRValue(): [AssignExpr] ... = ...
# 26| Type = [IntType] int
# 26| ValueCategory = prvalue
# 26| ValueCategory = prvalue(load)
# 26| getLValue(): [ValueFieldAccess] e
# 26| Type = [IntType] int
# 26| ValueCategory = lvalue
@@ -1406,7 +1406,7 @@ union_etc.cpp:
# 26| ValueCategory = lvalue
# 26| getRValue(): [AssignExpr] ... = ...
# 26| Type = [IntType] int
# 26| ValueCategory = prvalue
# 26| ValueCategory = prvalue(load)
# 26| getLValue(): [ValueFieldAccess] i
# 26| Type = [IntType] int
# 26| ValueCategory = lvalue
@@ -1488,7 +1488,7 @@ union_etc.cpp:
# 33| getExpr(): [AssignExpr] ... = ...
# 33| Type = [IntType] int
# 33| ValueCategory = lvalue
# 33| getLValue(): [PointerFieldAccess] q
# 33| getLValue(): [ImplicitThisFieldAccess,PointerFieldAccess] q
# 33| Type = [IntType] int
# 33| ValueCategory = lvalue
# 33| getQualifier(): [ThisExpr] this

View File

@@ -675,6 +675,7 @@
| test.c:398:9:398:22 | CopyValue: ... , ... | positive strictlyPositive |
| test.c:398:14:398:14 | Load: y | positive strictlyPositive |
| test.c:398:14:398:19 | Add: ... += ... | positive strictlyPositive |
| test.c:398:14:398:19 | Load: ... += ... | positive strictlyPositive |
| test.c:398:14:398:19 | Store: ... += ... | positive strictlyPositive |
| test.c:398:19:398:19 | Constant: (unsigned int)... | positive strictlyPositive |
| test.c:398:22:398:22 | Load: y | positive strictlyPositive |

View File

@@ -35,9 +35,7 @@ edges
| test.cpp:136:9:136:16 | ... += ... | test.cpp:138:13:138:15 | arr |
| test.cpp:143:18:143:21 | asdf | test.cpp:134:25:134:27 | arr |
| test.cpp:143:18:143:21 | asdf | test.cpp:143:18:143:21 | asdf |
| test.cpp:146:26:146:26 | p indirection | test.cpp:148:6:148:9 | * ... |
| test.cpp:146:26:146:26 | p indirection | test.cpp:149:6:149:9 | * ... |
| test.cpp:146:26:146:26 | p indirection | test.cpp:150:6:150:9 | * ... |
| test.cpp:146:26:146:26 | p indirection | test.cpp:147:4:147:9 | -- ... |
| test.cpp:156:12:156:14 | buf | test.cpp:156:12:156:18 | ... + ... |
| test.cpp:156:12:156:18 | ... + ... | test.cpp:158:17:158:18 | & ... indirection |
| test.cpp:158:17:158:18 | & ... indirection | test.cpp:146:26:146:26 | p indirection |
@@ -124,9 +122,7 @@ nodes
| test.cpp:143:18:143:21 | asdf | semmle.label | asdf |
| test.cpp:143:18:143:21 | asdf | semmle.label | asdf |
| test.cpp:146:26:146:26 | p indirection | semmle.label | p indirection |
| test.cpp:148:6:148:9 | * ... | semmle.label | * ... |
| test.cpp:149:6:149:9 | * ... | semmle.label | * ... |
| test.cpp:150:6:150:9 | * ... | semmle.label | * ... |
| test.cpp:147:4:147:9 | -- ... | semmle.label | -- ... |
| test.cpp:156:12:156:14 | buf | semmle.label | buf |
| test.cpp:156:12:156:18 | ... + ... | semmle.label | ... + ... |
| test.cpp:158:17:158:18 | & ... indirection | semmle.label | & ... indirection |
@@ -179,9 +175,7 @@ subpaths
| test.cpp:88:5:88:27 | PointerAdd: access to array | test.cpp:85:34:85:36 | buf | test.cpp:88:5:88:27 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:15:9:15:11 | buf | buf | test.cpp:88:5:88:31 | Store: ... = ... | write |
| test.cpp:128:9:128:14 | PointerAdd: access to array | test.cpp:128:9:128:11 | arr | test.cpp:128:9:128:14 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:125:11:125:13 | arr | arr | test.cpp:128:9:128:18 | Store: ... = ... | write |
| test.cpp:136:9:136:16 | PointerAdd: ... += ... | test.cpp:143:18:143:21 | asdf | test.cpp:138:13:138:15 | arr | This pointer arithmetic may have an off-by-2 error allowing it to overrun $@ at this $@. | test.cpp:142:10:142:13 | asdf | asdf | test.cpp:138:12:138:15 | Load: * ... | read |
| test.cpp:156:12:156:18 | PointerAdd: ... + ... | test.cpp:156:12:156:14 | buf | test.cpp:148:6:148:9 | * ... | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:154:7:154:9 | buf | buf | test.cpp:147:3:147:13 | Store: ... = ... | write |
| test.cpp:156:12:156:18 | PointerAdd: ... + ... | test.cpp:156:12:156:14 | buf | test.cpp:149:6:149:9 | * ... | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:154:7:154:9 | buf | buf | test.cpp:148:3:148:13 | Store: ... = ... | write |
| test.cpp:156:12:156:18 | PointerAdd: ... + ... | test.cpp:156:12:156:14 | buf | test.cpp:150:6:150:9 | * ... | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:154:7:154:9 | buf | buf | test.cpp:149:3:149:13 | Store: ... = ... | write |
| test.cpp:156:12:156:18 | PointerAdd: ... + ... | test.cpp:156:12:156:14 | buf | test.cpp:147:4:147:9 | -- ... | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:154:7:154:9 | buf | buf | test.cpp:147:3:147:13 | Store: ... = ... | write |
| test.cpp:221:5:221:11 | PointerAdd: access to array | test.cpp:218:23:218:28 | buffer | test.cpp:221:5:221:11 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:217:19:217:24 | buffer | buffer | test.cpp:221:5:221:15 | Store: ... = ... | write |
| test.cpp:232:5:232:10 | PointerAdd: access to array | test.cpp:229:25:229:29 | array | test.cpp:232:5:232:10 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:228:10:228:14 | array | array | test.cpp:232:5:232:19 | Store: ... = ... | write |
| test.cpp:261:27:261:30 | PointerAdd: access to array | test.cpp:286:19:286:25 | buffer2 | test.cpp:261:27:261:30 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:285:19:285:25 | buffer2 | buffer2 | test.cpp:261:27:261:30 | Load: access to array | read |

View File

@@ -1,6 +1,6 @@
| FieldAccess.cpp:11:12:11:13 | p1 | ptr |
| FieldAccess.cpp:12:12:12:13 | p2 | ptr |
| FieldAccess.cpp:25:12:25:13 | x1 | ptr |
| FieldAccess.cpp:11:12:11:13 | p1 | ptr, this |
| FieldAccess.cpp:12:12:12:13 | p2 | ptr, this |
| FieldAccess.cpp:25:12:25:13 | x1 | ptr, this |
| FieldAccess.cpp:29:18:29:19 | x2 | ptr |
| FieldAccess.cpp:34:3:34:3 | d | this |
| FieldAccess.cpp:45:13:45:14 | x1 | ptr |
@@ -19,10 +19,10 @@
| FieldAccess.cpp:91:7:91:7 | x | val |
| FieldAccess.cpp:91:13:91:13 | y | ref |
| FieldAccess.cpp:92:8:92:8 | x | ptr |
| FieldAccess.cpp:92:12:92:12 | y | ptr |
| FieldAccess.cpp:92:12:92:12 | y | ptr, this |
| FieldAccess.cpp:93:8:93:8 | x | ptr |
| FieldAccess.cpp:93:18:93:18 | y | ptr |
| FieldAccess.cpp:94:11:94:11 | y | ptr |
| FieldAccess.cpp:94:20:94:20 | y | val |
| FieldAccess.cpp:113:5:113:5 | x | ptr |
| FieldAccess.cpp:113:5:113:5 | x | ptr, this |
| FieldAccess.cpp:116:3:116:3 | v | this |

View File

@@ -1,2 +1,2 @@
static int clang421 = __has_feature(attribute_deprecated_with_message);
// semmle-extractor-options: --gnu_version 40201 --edg --clang
// semmle-extractor-options: --gnu_version 40201 --clang_version 30400

View File

@@ -1,2 +1,2 @@
static int clang450 = __has_feature(attribute_deprecated_with_message);
// semmle-extractor-options: --gnu_version 40500 --edg --clang
// semmle-extractor-options: --gnu_version 40500 --clang_version 30500

View File

@@ -1,2 +1,2 @@
static int gcc421 = __has_feature(attribute_deprecated_with_message);
// semmle-extractor-options: --gnu_version 40201 --edg --clang
// semmle-extractor-options: --gnu_version 40201

View File

@@ -1,2 +1,2 @@
static int gcc450 = __has_feature(attribute_deprecated_with_message);
// semmle-extractor-options: --gnu_version 40500 --edg --clang
// semmle-extractor-options: --gnu_version 40500

View File

@@ -14,17 +14,14 @@ localCallNodes
postIsNotPre
postHasUniquePre
uniquePostUpdate
| example.c:24:13:24:18 | coords indirection | Node has multiple PostUpdateNodes. |
postIsInSameCallable
reverseRead
argHasPostUpdate
postWithInFlow
| test.cpp:384:10:384:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
| test.cpp:384:10:384:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
| test.cpp:391:10:391:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
| test.cpp:391:10:391:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
| test.cpp:400:10:400:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
| test.cpp:400:10:400:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
| test.cpp:407:10:407:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
| test.cpp:407:10:407:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
viableImplInCallContextTooLarge
uniqueParameterNodeAtPosition

View File

@@ -1,6 +1,19 @@
private import semmle.code.cpp.ir.dataflow.DataFlow
private import DataFlow
private class TestAdditionalCallTarget extends AdditionalCallTarget {
override Function viableTarget(Call call) {
// To test that call targets specified by `AdditionalCallTarget` are
// resolved correctly this subclass resolves all calls to
// `call_template_argument<f>(x)` as if the user had written `f(x)`.
exists(FunctionTemplateInstantiation inst |
inst.getTemplate().hasName("call_template_argument") and
call.getTarget() = inst and
result = inst.getTemplateArgument(0).(FunctionAccess).getTarget()
)
}
}
module IRConfig implements ConfigSig {
predicate isSource(Node src) {
src.asExpr() instanceof NewExpr

View File

@@ -44,8 +44,6 @@ reverseRead
argHasPostUpdate
postWithInFlow
| realistic.cpp:54:16:54:47 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
| realistic.cpp:54:16:54:47 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
| realistic.cpp:60:16:60:18 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
| realistic.cpp:60:16:60:18 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
viableImplInCallContextTooLarge
uniqueParameterNodeAtPosition

View File

@@ -770,6 +770,9 @@ edges
| simple.cpp:92:7:92:7 | a indirection [post update] [i] | simple.cpp:94:10:94:11 | a2 indirection [i] |
| simple.cpp:92:11:92:20 | call to user_input | simple.cpp:92:5:92:22 | ... = ... |
| simple.cpp:94:10:94:11 | a2 indirection [i] | simple.cpp:94:13:94:13 | i |
| simple.cpp:103:24:103:24 | x | simple.cpp:104:14:104:14 | x |
| simple.cpp:108:17:108:26 | call to user_input | simple.cpp:109:43:109:43 | x |
| simple.cpp:109:43:109:43 | x | simple.cpp:103:24:103:24 | x |
| struct_init.c:14:24:14:25 | ab indirection [a] | struct_init.c:15:8:15:9 | ab indirection [a] |
| struct_init.c:15:8:15:9 | ab indirection [a] | struct_init.c:15:12:15:12 | a |
| struct_init.c:20:13:20:14 | definition of ab indirection [a] | struct_init.c:22:8:22:9 | ab indirection [a] |
@@ -1576,6 +1579,10 @@ nodes
| simple.cpp:92:11:92:20 | call to user_input | semmle.label | call to user_input |
| simple.cpp:94:10:94:11 | a2 indirection [i] | semmle.label | a2 indirection [i] |
| simple.cpp:94:13:94:13 | i | semmle.label | i |
| simple.cpp:103:24:103:24 | x | semmle.label | x |
| simple.cpp:104:14:104:14 | x | semmle.label | x |
| simple.cpp:108:17:108:26 | call to user_input | semmle.label | call to user_input |
| simple.cpp:109:43:109:43 | x | semmle.label | x |
| struct_init.c:14:24:14:25 | ab indirection [a] | semmle.label | ab indirection [a] |
| struct_init.c:15:8:15:9 | ab indirection [a] | semmle.label | ab indirection [a] |
| struct_init.c:15:12:15:12 | a | semmle.label | a |
@@ -1782,6 +1789,7 @@ subpaths
| simple.cpp:67:13:67:13 | i | simple.cpp:65:11:65:20 | call to user_input | simple.cpp:67:13:67:13 | i | i flows from $@ | simple.cpp:65:11:65:20 | call to user_input | call to user_input |
| simple.cpp:84:14:84:20 | call to getf2f1 | simple.cpp:83:17:83:26 | call to user_input | simple.cpp:84:14:84:20 | call to getf2f1 | call to getf2f1 flows from $@ | simple.cpp:83:17:83:26 | call to user_input | call to user_input |
| simple.cpp:94:13:94:13 | i | simple.cpp:92:11:92:20 | call to user_input | simple.cpp:94:13:94:13 | i | i flows from $@ | simple.cpp:92:11:92:20 | call to user_input | call to user_input |
| simple.cpp:104:14:104:14 | x | simple.cpp:108:17:108:26 | call to user_input | simple.cpp:104:14:104:14 | x | x flows from $@ | simple.cpp:108:17:108:26 | call to user_input | call to user_input |
| struct_init.c:15:12:15:12 | a | struct_init.c:20:20:20:29 | call to user_input | struct_init.c:15:12:15:12 | a | a flows from $@ | struct_init.c:20:20:20:29 | call to user_input | call to user_input |
| struct_init.c:15:12:15:12 | a | struct_init.c:27:7:27:16 | call to user_input | struct_init.c:15:12:15:12 | a | a flows from $@ | struct_init.c:27:7:27:16 | call to user_input | call to user_input |
| struct_init.c:15:12:15:12 | a | struct_init.c:40:20:40:29 | call to user_input | struct_init.c:15:12:15:12 | a | a flows from $@ | struct_init.c:40:20:40:29 | call to user_input | call to user_input |

View File

@@ -94,4 +94,21 @@ void single_field_test_typedef(A_typedef a)
sink(a2.i); //$ ast,ir
}
namespace TestAdditionalCallTargets {
using TakesIntReturnsVoid = void(*)(int);
template<TakesIntReturnsVoid F>
void call_template_argument(int);
void call_sink(int x) {
sink(x); // $ ir
}
void test_additional_call_targets() {
int x = user_input();
call_template_argument<call_sink>(x);
}
}
} // namespace Simple

View File

@@ -2199,6 +2199,19 @@ WARNING: Module TaintTracking has been deprecated and may be removed in future (
| map.cpp:436:55:436:59 | def | map.cpp:436:19:436:60 | call to pair | TAINT |
| map.cpp:436:63:436:67 | first | map.cpp:436:7:436:67 | call to iterator | |
| map.cpp:437:7:437:9 | m35 | map.cpp:437:7:437:9 | call to unordered_map | |
| map.cpp:446:23:446:23 | call to map | map.cpp:448:3:448:3 | m | |
| map.cpp:446:23:446:23 | call to map | map.cpp:449:12:449:12 | m | |
| map.cpp:446:23:446:23 | call to map | map.cpp:451:1:451:1 | m | |
| map.cpp:447:12:447:26 | call to indirect_source | map.cpp:448:10:448:10 | p | |
| map.cpp:448:3:448:3 | m | map.cpp:448:4:448:4 | call to operator[] | TAINT |
| map.cpp:448:3:448:3 | ref arg m | map.cpp:449:12:449:12 | m | |
| map.cpp:448:3:448:3 | ref arg m | map.cpp:451:1:451:1 | m | |
| map.cpp:448:3:448:10 | ... = ... | map.cpp:448:4:448:4 | call to operator[] [post update] | |
| map.cpp:448:4:448:4 | call to operator[] [post update] | map.cpp:448:3:448:3 | ref arg m | TAINT |
| map.cpp:448:10:448:10 | p | map.cpp:448:3:448:10 | ... = ... | |
| map.cpp:449:12:449:12 | m | map.cpp:449:13:449:13 | call to operator[] | TAINT |
| map.cpp:449:12:449:12 | ref arg m | map.cpp:451:1:451:1 | m | |
| map.cpp:449:13:449:13 | call to operator[] | map.cpp:450:8:450:8 | q | |
| movableclass.cpp:8:2:8:15 | this | movableclass.cpp:8:27:8:31 | constructor init of field v [pre-this] | |
| movableclass.cpp:8:21:8:22 | _v | movableclass.cpp:8:29:8:30 | _v | |
| movableclass.cpp:8:29:8:30 | _v | movableclass.cpp:8:27:8:31 | constructor init of field v | TAINT |
@@ -6609,6 +6622,27 @@ WARNING: Module TaintTracking has been deprecated and may be removed in future (
| taint.cpp:711:13:711:13 | s | taint.cpp:711:2:711:8 | call to strncpy | TAINT |
| taint.cpp:711:13:711:13 | s | taint.cpp:711:10:711:10 | ref arg d | TAINT |
| taint.cpp:712:7:712:7 | ref arg d | taint.cpp:709:25:709:25 | d | |
| taint.cpp:718:17:718:31 | call to indirect_source | taint.cpp:720:27:720:32 | source | |
| taint.cpp:719:22:719:29 | ,.-;:_ | taint.cpp:720:35:720:39 | delim | |
| taint.cpp:719:22:719:29 | ,.-;:_ | taint.cpp:722:8:722:12 | delim | |
| taint.cpp:720:20:720:25 | call to strtok | taint.cpp:721:8:721:16 | tokenized | |
| taint.cpp:720:27:720:32 | source | taint.cpp:720:20:720:25 | call to strtok | TAINT |
| taint.cpp:721:8:721:16 | tokenized | taint.cpp:721:7:721:16 | * ... | TAINT |
| taint.cpp:722:8:722:12 | delim | taint.cpp:722:7:722:12 | * ... | TAINT |
| taint.cpp:727:24:727:29 | source | taint.cpp:727:24:727:29 | source | |
| taint.cpp:727:24:727:29 | source | taint.cpp:729:18:729:23 | source | |
| taint.cpp:728:17:728:23 | 0 | taint.cpp:729:27:729:32 | endptr | |
| taint.cpp:728:17:728:23 | 0 | taint.cpp:731:7:731:12 | endptr | |
| taint.cpp:728:17:728:23 | 0 | taint.cpp:732:8:732:13 | endptr | |
| taint.cpp:729:11:729:16 | call to strtol | taint.cpp:730:7:730:7 | l | |
| taint.cpp:729:18:729:23 | source | taint.cpp:729:11:729:16 | call to strtol | TAINT |
| taint.cpp:729:18:729:23 | source | taint.cpp:729:26:729:32 | ref arg & ... | TAINT |
| taint.cpp:729:26:729:32 | ref arg & ... | taint.cpp:729:27:729:32 | endptr [inner post update] | |
| taint.cpp:729:26:729:32 | ref arg & ... | taint.cpp:731:7:731:12 | endptr | |
| taint.cpp:729:26:729:32 | ref arg & ... | taint.cpp:732:8:732:13 | endptr | |
| taint.cpp:729:27:729:32 | endptr | taint.cpp:729:26:729:32 | & ... | |
| taint.cpp:731:7:731:12 | ref arg endptr | taint.cpp:732:8:732:13 | endptr | |
| taint.cpp:732:8:732:13 | endptr | taint.cpp:732:7:732:13 | * ... | TAINT |
| 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

@@ -165,9 +165,9 @@ void test_map()
// array-like access
std::map<char *, char *> m10, m11, m12, m13;
sink(m10["abc"] = "def");
sink(m11["abc"] = source()); // $ ast ir=168:7 ir=168:20
sink(m11["abc"] = source()); // $ ast,ir
sink(m12.at("abc") = "def");
sink(m13.at("abc") = source()); // $ ast ir=170:7 ir=170:23
sink(m13.at("abc") = source()); // $ ast,ir
sink(m10["abc"]);
sink(m11["abc"]); // $ ast,ir
sink(m12["abc"]);
@@ -317,9 +317,9 @@ void test_unordered_map()
// array-like access
std::unordered_map<char *, char *> m10, m11, m12, m13;
sink(m10["abc"] = "def");
sink(m11["abc"] = source()); // $ ast ir=320:7 ir=320:20
sink(m11["abc"] = source()); // $ ast,ir
sink(m12.at("abc") = "def");
sink(m13.at("abc") = source()); // $ ast ir=322:7 ir=322:23
sink(m13.at("abc") = source()); // $ ast,ir
sink(m10["abc"]);
sink(m11["abc"]); // $ ast,ir
sink(m12["abc"]);
@@ -436,3 +436,16 @@ void test_unordered_map()
sink(m35.emplace(std::pair<char *, char *>(source(), "def")).first); // $ MISSING: ast,ir
sink(m35); // $ MISSING: ast,ir
}
namespace {
int* indirect_source();
void indirect_sink(int*);
}
void test_indirect_taint() {
std::map<int, int*> m;
int* p = indirect_source();
m[1] = p;
int* q = m[1];
sink(q); // $ ir MISSING: ast
}

View File

@@ -13,8 +13,8 @@ void arithAssignments(int source1, int clean1) {
source1++;
++source1;
source1 += 1;
sink(source1); // $ ast ir=12:13 ir=12:22
sink(++source1); // $ ast ir=12:13 ir=12:22
sink(source1); // $ ast,ir
sink(++source1); // $ ast,ir
}
// --- globals ---
@@ -710,4 +710,24 @@ void test_strncpy(char* d, char* s) {
argument_source(s);
strncpy(d, s, 16);
sink(d); // $ ast ir
}
char* indirect_source();
void test_strtok_indirect() {
char *source = indirect_source();
const char* delim = ",.-;:_";
char* tokenized = strtok(source, delim);
sink(*tokenized); // $ ir MISSING: ast
sink(*delim);
}
long int strtol(const char*, char**, int);
void test_strtol(char *source) {
char* endptr = nullptr;
long l = strtol(source, &endptr, 10);
sink(l); // $ ast,ir
sink(endptr); // $ ast,ir
sink(*endptr); // $ ast,ir
}

View File

@@ -84,6 +84,8 @@ module IRTest {
or
source.asIndirectExpr().(FunctionCall).getTarget().getName() = "source"
or
source.asIndirectExpr().(FunctionCall).getTarget().getName() = "indirect_source"
or
source.asParameter().getName().matches("source%")
or
exists(FunctionCall fc |

View File

@@ -83,7 +83,7 @@ bad_asts.cpp:
# 10| Type = [IntType] int
# 10| Value = [Literal] 6
# 10| ValueCategory = prvalue
# 10| getRightOperand(): [PointerFieldAccess] x
# 10| getRightOperand(): [ImplicitThisFieldAccess,PointerFieldAccess] x
# 10| Type = [IntType] int
# 10| ValueCategory = prvalue(load)
# 10| getQualifier(): [ThisExpr] this
@@ -108,7 +108,7 @@ bad_asts.cpp:
# 10| Type = [IntType] int
# 10| Value = [Literal] t
# 10| ValueCategory = prvalue
# 10| getRightOperand(): [PointerFieldAccess] x
# 10| getRightOperand(): [ImplicitThisFieldAccess,PointerFieldAccess] x
# 10| Type = [IntType] int
# 10| ValueCategory = prvalue(load)
# 10| getQualifier(): [ThisExpr] this
@@ -1761,7 +1761,7 @@ ir.c:
# 9| ValueCategory = lvalue
# 9| getRValue(): [AssignExpr] ... = ...
# 9| Type = [IntType] int
# 9| ValueCategory = prvalue
# 9| ValueCategory = prvalue(load)
# 9| getLValue(): [ValueFieldAccess] y
# 9| Type = [IntType] int
# 9| ValueCategory = lvalue
@@ -2675,7 +2675,7 @@ ir.cpp:
# 101| ValueCategory = lvalue
# 101| getRValue(): [PrefixIncrExpr] ++ ...
# 101| Type = [IntType] int
# 101| ValueCategory = prvalue
# 101| ValueCategory = prvalue(load)
# 101| getOperand(): [VariableAccess] x
# 101| Type = [IntType] int
# 101| ValueCategory = lvalue
@@ -2688,7 +2688,7 @@ ir.cpp:
# 102| ValueCategory = lvalue
# 102| getRValue(): [PrefixDecrExpr] -- ...
# 102| Type = [IntType] int
# 102| ValueCategory = prvalue
# 102| ValueCategory = prvalue(load)
# 102| getOperand(): [VariableAccess] x
# 102| Type = [IntType] int
# 102| ValueCategory = lvalue
@@ -3041,7 +3041,7 @@ ir.cpp:
# 147| ValueCategory = lvalue
# 147| getRValue(): [PrefixIncrExpr] ++ ...
# 147| Type = [FloatType] float
# 147| ValueCategory = prvalue
# 147| ValueCategory = prvalue(load)
# 147| getOperand(): [VariableAccess] x
# 147| Type = [FloatType] float
# 147| ValueCategory = lvalue
@@ -3054,7 +3054,7 @@ ir.cpp:
# 148| ValueCategory = lvalue
# 148| getRValue(): [PrefixDecrExpr] -- ...
# 148| Type = [FloatType] float
# 148| ValueCategory = prvalue
# 148| ValueCategory = prvalue(load)
# 148| getOperand(): [VariableAccess] x
# 148| Type = [FloatType] float
# 148| ValueCategory = lvalue
@@ -3557,7 +3557,7 @@ ir.cpp:
# 207| ValueCategory = lvalue
# 207| getRValue(): [PrefixIncrExpr] ++ ...
# 207| Type = [IntPointerType] int *
# 207| ValueCategory = prvalue
# 207| ValueCategory = prvalue(load)
# 207| getOperand(): [VariableAccess] p
# 207| Type = [IntPointerType] int *
# 207| ValueCategory = lvalue
@@ -3570,7 +3570,7 @@ ir.cpp:
# 208| ValueCategory = lvalue
# 208| getRValue(): [PrefixDecrExpr] -- ...
# 208| Type = [IntPointerType] int *
# 208| ValueCategory = prvalue
# 208| ValueCategory = prvalue(load)
# 208| getOperand(): [VariableAccess] p
# 208| Type = [IntPointerType] int *
# 208| ValueCategory = lvalue
@@ -4825,7 +4825,7 @@ ir.cpp:
# 483| getVariable().getInitializer(): [Initializer] initializer for z
# 483| getExpr(): [ConditionalExpr] ... ? ... : ...
# 483| Type = [IntType] int
# 483| ValueCategory = prvalue
# 483| ValueCategory = prvalue(load)
# 483| getCondition(): [VariableAccess] a
# 483| Type = [BoolType] bool
# 483| ValueCategory = prvalue(load)
@@ -5718,7 +5718,7 @@ ir.cpp:
# 645| getExpr(): [AssignExpr] ... = ...
# 645| Type = [IntType] int
# 645| ValueCategory = lvalue
# 645| getLValue(): [PointerFieldAccess] m_a
# 645| getLValue(): [ImplicitThisFieldAccess,PointerFieldAccess] m_a
# 645| Type = [IntType] int
# 645| ValueCategory = lvalue
# 645| getQualifier(): [ThisExpr] this
@@ -5770,7 +5770,7 @@ ir.cpp:
# 649| getLValue(): [VariableAccess] x
# 649| Type = [IntType] int
# 649| ValueCategory = lvalue
# 649| getRValue(): [PointerFieldAccess] m_a
# 649| getRValue(): [ImplicitThisFieldAccess,PointerFieldAccess] m_a
# 649| Type = [IntType] int
# 649| ValueCategory = prvalue(load)
# 649| getQualifier(): [ThisExpr] this
@@ -6025,7 +6025,7 @@ ir.cpp:
# 705| getStmt(0): [ReturnStmt] return ...
# 705| getExpr(): [ConditionalExpr] ... ? ... : ...
# 705| Type = [UnknownType] unknown
# 705| ValueCategory = prvalue(load)
# 705| ValueCategory = prvalue
# 705| getCondition(): [LTExpr] ... < ...
# 705| Type = [UnknownType] unknown
# 705| ValueCategory = prvalue
@@ -6058,7 +6058,7 @@ ir.cpp:
# 705| getStmt(0): [ReturnStmt] return ...
# 705| getExpr(): [ConditionalExpr] ... ? ... : ...
# 705| Type = [IntType] int
# 705| ValueCategory = prvalue
# 705| ValueCategory = prvalue(load)
# 705| getCondition(): [LTExpr] ... < ...
# 705| Type = [BoolType] bool
# 705| ValueCategory = prvalue
@@ -7864,7 +7864,7 @@ ir.cpp:
# 915| getVariable().getInitializer(): [Initializer] initializer for b
# 915| getExpr(): [ConditionalExpr] ... ? ... : ...
# 915| Type = [IntType] int
# 915| ValueCategory = prvalue
# 915| ValueCategory = prvalue(load)
# 915| getCondition(): [Literal] 1
# 915| Type = [BoolType] bool
# 915| Value = [Literal] 1
@@ -8633,6 +8633,9 @@ ir.cpp:
# 1038| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [RValueReferenceType] lambda [] type at line 1038, col. 12 &&
# 1038| <initializations>:
# 1038| getEntryPoint(): [BlockStmt] { ... }
# 1038| getStmt(0): [ReturnStmt] return ...
# 1038| [Constructor] void (lambda [] type at line 1038, col. 12)::(unnamed constructor)()
# 1038| <params>:
# 1038| [MemberFunction] void (lambda [] type at line 1038, col. 12)::_FUN()
@@ -8963,6 +8966,9 @@ ir.cpp:
# 1041| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [RValueReferenceType] lambda [] type at line 1041, col. 23 &&
# 1041| <initializations>:
# 1041| getEntryPoint(): [BlockStmt] { ... }
# 1041| getStmt(0): [ReturnStmt] return ...
# 1041| [Constructor] void (void Lambda(int, String const&))::(lambda [] type at line 1041, col. 23)::(unnamed constructor)()
# 1041| <params>:
# 1041| [MemberFunction] char (void Lambda(int, String const&))::(lambda [] type at line 1041, col. 23)::_FUN(float)
@@ -9012,7 +9018,7 @@ ir.cpp:
# 1043| getArrayBase(): [FunctionCall] call to c_str
# 1043| Type = [PointerType] const char *
# 1043| ValueCategory = prvalue
# 1043| getQualifier(): [PointerFieldAccess] s
# 1043| getQualifier(): [ImplicitThisFieldAccess,PointerFieldAccess] s
# 1043| Type = [LValueReferenceType] const String &
# 1043| ValueCategory = prvalue(load)
# 1043| getQualifier(): [ThisExpr] this
@@ -9021,7 +9027,7 @@ ir.cpp:
# 1043| getQualifier().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1043| Type = [SpecifiedType] const String
# 1043| ValueCategory = lvalue
# 1043| getArrayOffset(): [PointerFieldAccess] x
# 1043| getArrayOffset(): [ImplicitThisFieldAccess,PointerFieldAccess] x
# 1043| Type = [LValueReferenceType] int &
# 1043| ValueCategory = prvalue(load)
# 1043| getQualifier(): [ThisExpr] this
@@ -9070,13 +9076,13 @@ ir.cpp:
# 1045| getArrayBase(): [FunctionCall] call to c_str
# 1045| Type = [PointerType] const char *
# 1045| ValueCategory = prvalue
# 1045| getQualifier(): [PointerFieldAccess] s
# 1045| getQualifier(): [ImplicitThisFieldAccess,PointerFieldAccess] s
# 1045| Type = [SpecifiedType] const String
# 1045| ValueCategory = lvalue
# 1045| getQualifier(): [ThisExpr] this
# 1045| Type = [PointerType] const lambda [] type at line 1045, col. 21 *
# 1045| ValueCategory = prvalue(load)
# 1045| getArrayOffset(): [PointerFieldAccess] x
# 1045| getArrayOffset(): [ImplicitThisFieldAccess,PointerFieldAccess] x
# 1045| Type = [IntType] int
# 1045| ValueCategory = prvalue(load)
# 1045| getQualifier(): [ThisExpr] this
@@ -9108,7 +9114,7 @@ ir.cpp:
# 1047| getArrayBase(): [FunctionCall] call to c_str
# 1047| Type = [PointerType] const char *
# 1047| ValueCategory = prvalue
# 1047| getQualifier(): [PointerFieldAccess] s
# 1047| getQualifier(): [ImplicitThisFieldAccess,PointerFieldAccess] s
# 1047| Type = [LValueReferenceType] const String &
# 1047| ValueCategory = prvalue(load)
# 1047| getQualifier(): [ThisExpr] this
@@ -9161,7 +9167,7 @@ ir.cpp:
# 1049| getArrayBase(): [FunctionCall] call to c_str
# 1049| Type = [PointerType] const char *
# 1049| ValueCategory = prvalue
# 1049| getQualifier(): [PointerFieldAccess] s
# 1049| getQualifier(): [ImplicitThisFieldAccess,PointerFieldAccess] s
# 1049| Type = [SpecifiedType] const String
# 1049| ValueCategory = lvalue
# 1049| getQualifier(): [ThisExpr] this
@@ -9197,7 +9203,7 @@ ir.cpp:
# 1051| getArrayBase(): [FunctionCall] call to c_str
# 1051| Type = [PointerType] const char *
# 1051| ValueCategory = prvalue
# 1051| getQualifier(): [PointerFieldAccess] s
# 1051| getQualifier(): [ImplicitThisFieldAccess,PointerFieldAccess] s
# 1051| Type = [LValueReferenceType] const String &
# 1051| ValueCategory = prvalue(load)
# 1051| getQualifier(): [ThisExpr] this
@@ -9206,7 +9212,7 @@ ir.cpp:
# 1051| getQualifier().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1051| Type = [SpecifiedType] const String
# 1051| ValueCategory = lvalue
# 1051| getArrayOffset(): [PointerFieldAccess] x
# 1051| getArrayOffset(): [ImplicitThisFieldAccess,PointerFieldAccess] x
# 1051| Type = [IntType] int
# 1051| ValueCategory = prvalue(load)
# 1051| getQualifier(): [ThisExpr] this
@@ -9238,7 +9244,7 @@ ir.cpp:
# 1054| getArrayBase(): [FunctionCall] call to c_str
# 1054| Type = [PointerType] const char *
# 1054| ValueCategory = prvalue
# 1054| getQualifier(): [PointerFieldAccess] s
# 1054| getQualifier(): [ImplicitThisFieldAccess,PointerFieldAccess] s
# 1054| Type = [LValueReferenceType] const String &
# 1054| ValueCategory = prvalue(load)
# 1054| getQualifier(): [ThisExpr] this
@@ -9253,7 +9259,7 @@ ir.cpp:
# 1054| getLeftOperand(): [AddExpr] ... + ...
# 1054| Type = [IntType] int
# 1054| ValueCategory = prvalue
# 1054| getLeftOperand(): [PointerFieldAccess] x
# 1054| getLeftOperand(): [ImplicitThisFieldAccess,PointerFieldAccess] x
# 1054| Type = [IntType] int
# 1054| ValueCategory = prvalue(load)
# 1054| getQualifier(): [ThisExpr] this
@@ -10456,7 +10462,7 @@ ir.cpp:
# 1301| ValueCategory = lvalue
# 1301| getRValue(): [ConditionalExpr] ... ? ... : ...
# 1301| Type = [IntType] int
# 1301| ValueCategory = prvalue
# 1301| ValueCategory = prvalue(load)
# 1301| getCondition(): [VariableAccess] b
# 1301| Type = [BoolType] bool
# 1301| ValueCategory = prvalue(load)
@@ -10472,7 +10478,7 @@ ir.cpp:
# 1302| ValueCategory = lvalue
# 1302| getRValue(): [ConditionalExpr] ... ? ... : ...
# 1302| Type = [LongType] long
# 1302| ValueCategory = prvalue
# 1302| ValueCategory = prvalue(load)
# 1302| getCondition(): [VariableAccess] b
# 1302| Type = [BoolType] bool
# 1302| ValueCategory = prvalue(load)
@@ -10492,7 +10498,7 @@ ir.cpp:
# 1303| ValueCategory = lvalue
# 1303| getRValue(): [ConditionalExpr] ... ? ... : ...
# 1303| Type = [IntType] int
# 1303| ValueCategory = prvalue
# 1303| ValueCategory = prvalue(load)
# 1303| getCondition(): [VariableAccess] x
# 1303| Type = [IntType] int
# 1303| ValueCategory = prvalue(load)
@@ -10512,7 +10518,7 @@ ir.cpp:
# 1304| ValueCategory = lvalue
# 1304| getRValue(): [ConditionalExpr] ... ? ... : ...
# 1304| Type = [LongType] long
# 1304| ValueCategory = prvalue
# 1304| ValueCategory = prvalue(load)
# 1304| getCondition(): [VariableAccess] x
# 1304| Type = [IntType] int
# 1304| ValueCategory = prvalue(load)
@@ -10536,7 +10542,7 @@ ir.cpp:
# 1305| ValueCategory = lvalue
# 1305| getRValue(): [ConditionalExpr] ... ? ... : ...
# 1305| Type = [LongType] long
# 1305| ValueCategory = prvalue
# 1305| ValueCategory = prvalue(load)
# 1305| getCondition(): [VariableAccess] y
# 1305| Type = [LongType] long
# 1305| ValueCategory = prvalue(load)
@@ -10564,7 +10570,7 @@ ir.cpp:
# 1306| ValueCategory = lvalue
# 1306| getRValue(): [ConditionalExpr] ... ? ... : ...
# 1306| Type = [LongType] long
# 1306| ValueCategory = prvalue
# 1306| ValueCategory = prvalue(load)
# 1306| getCondition(): [VariableAccess] y
# 1306| Type = [LongType] long
# 1306| ValueCategory = prvalue(load)
@@ -10588,7 +10594,7 @@ ir.cpp:
# 1308| ValueCategory = lvalue
# 1308| getRValue(): [ConditionalExpr] ... ? ... : ...
# 1308| Type = [IntType] int
# 1308| ValueCategory = prvalue
# 1308| ValueCategory = prvalue(load)
# 1308| getCondition(): [LogicalOrExpr] ... || ...
# 1308| Type = [BoolType] bool
# 1308| ValueCategory = prvalue
@@ -10633,7 +10639,7 @@ ir.cpp:
# 1315| getStmt(0): [ReturnStmt] return ...
# 1315| getExpr(): [ConditionalExpr] ... ? ... : ...
# 1315| Type = [IntType] int
# 1315| ValueCategory = prvalue
# 1315| ValueCategory = prvalue(load)
# 1315| getCondition(): [LogicalAndExpr] ... && ...
# 1315| Type = [BoolType] bool
# 1315| ValueCategory = prvalue
@@ -10949,7 +10955,7 @@ ir.cpp:
# 1376| ValueCategory = prvalue
# 1376| getExpr().getFullyConverted(): [TemporaryObjectExpr] temporary object
# 1376| Type = [Struct] String
# 1376| ValueCategory = prvalue(load)
# 1376| ValueCategory = prvalue
# 1377| getStmt(9): [ReturnStmt] return ...
# 1379| [TopLevelFunction] void temporary_destructor_only()
# 1379| <params>:
@@ -11032,7 +11038,7 @@ ir.cpp:
# 1388| ValueCategory = prvalue
# 1388| getExpr().getFullyConverted(): [TemporaryObjectExpr] temporary object
# 1388| Type = [Class] destructor_only
# 1388| ValueCategory = prvalue(load)
# 1388| ValueCategory = prvalue
# 1389| getStmt(8): [ReturnStmt] return ...
# 1391| [TopLevelFunction] void temporary_copy_constructor()
# 1391| <params>:
@@ -11128,7 +11134,7 @@ ir.cpp:
# 1399| ValueCategory = prvalue
# 1399| getExpr().getFullyConverted(): [TemporaryObjectExpr] temporary object
# 1399| Type = [Class] copy_constructor
# 1399| ValueCategory = prvalue(load)
# 1399| ValueCategory = prvalue
# 1401| getStmt(8): [DeclStmt] declaration
# 1401| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y
# 1401| Type = [IntType] int
@@ -11484,7 +11490,7 @@ ir.cpp:
# 1458| getExpr(): [AssignExpr] ... = ...
# 1458| Type = [IntType] int
# 1458| ValueCategory = lvalue
# 1458| getLValue(): [PointerFieldAccess] y
# 1458| getLValue(): [ImplicitThisFieldAccess,PointerFieldAccess] y
# 1458| Type = [IntType] int
# 1458| ValueCategory = lvalue
# 1458| getQualifier(): [ThisExpr] this
@@ -12296,7 +12302,7 @@ ir.cpp:
# 1567| <params>:
# 1567| getEntryPoint(): [BlockStmt] { ... }
# 1568| getStmt(0): [ReturnStmt] return ...
# 1568| getExpr(): [PointerFieldAccess] i
# 1568| getExpr(): [ImplicitThisFieldAccess,PointerFieldAccess] i
# 1568| Type = [IntType] int
# 1568| ValueCategory = lvalue
# 1568| getQualifier(): [ThisExpr] this
@@ -12309,7 +12315,7 @@ ir.cpp:
# 1571| <params>:
# 1571| getEntryPoint(): [BlockStmt] { ... }
# 1572| getStmt(0): [ReturnStmt] return ...
# 1572| getExpr(): [PointerFieldAccess] d
# 1572| getExpr(): [ImplicitThisFieldAccess,PointerFieldAccess] d
# 1572| Type = [DoubleType] double
# 1572| ValueCategory = lvalue
# 1572| getQualifier(): [ThisExpr] this
@@ -12322,7 +12328,7 @@ ir.cpp:
# 1575| <params>:
# 1575| getEntryPoint(): [BlockStmt] { ... }
# 1576| getStmt(0): [ReturnStmt] return ...
# 1576| getExpr(): [PointerFieldAccess] r
# 1576| getExpr(): [ImplicitThisFieldAccess,PointerFieldAccess] r
# 1576| Type = [LValueReferenceType] int &
# 1576| ValueCategory = prvalue(load)
# 1576| getQualifier(): [ThisExpr] this
@@ -12663,7 +12669,7 @@ ir.cpp:
# 1633| <params>:
# 1633| getEntryPoint(): [BlockStmt] { ... }
# 1634| getStmt(0): [ReturnStmt] return ...
# 1634| getExpr(): [PointerFieldAccess] i
# 1634| getExpr(): [ImplicitThisFieldAccess,PointerFieldAccess] i
# 1634| Type = [IntType] int
# 1634| ValueCategory = prvalue(load)
# 1634| getQualifier(): [ThisExpr] this
@@ -12673,7 +12679,7 @@ ir.cpp:
# 1637| <params>:
# 1637| getEntryPoint(): [BlockStmt] { ... }
# 1638| getStmt(0): [ReturnStmt] return ...
# 1638| getExpr(): [PointerFieldAccess] r
# 1638| getExpr(): [ImplicitThisFieldAccess,PointerFieldAccess] r
# 1638| Type = [LValueReferenceType] int &
# 1638| ValueCategory = prvalue(load)
# 1638| getQualifier(): [ThisExpr] this
@@ -13284,7 +13290,7 @@ ir.cpp:
# 1703| getQualifier(): [AddressOfExpr] & ...
# 1703| Type = [PointerType] const TrivialLambdaClass *
# 1703| ValueCategory = prvalue
# 1703| getOperand(): [PointerFieldAccess] (captured this)
# 1703| getOperand(): [ImplicitThisFieldAccess,PointerFieldAccess] (captured this)
# 1703| Type = [SpecifiedType] const TrivialLambdaClass
# 1703| ValueCategory = lvalue
# 1703| getQualifier(): [ThisExpr] this
@@ -13331,7 +13337,7 @@ ir.cpp:
# 1706| getQualifier(): [AddressOfExpr] & ...
# 1706| Type = [PointerType] const TrivialLambdaClass *
# 1706| ValueCategory = prvalue
# 1706| getOperand(): [PointerFieldAccess] (captured this)
# 1706| getOperand(): [ImplicitThisFieldAccess,PointerFieldAccess] (captured this)
# 1706| Type = [SpecifiedType] const TrivialLambdaClass
# 1706| ValueCategory = lvalue
# 1706| getQualifier(): [ThisExpr] this
@@ -13368,9 +13374,6 @@ ir.cpp:
# 1714| getExpr(): [TemporaryObjectExpr] temporary object
# 1714| Type = [Class] TrivialLambdaClass
# 1714| ValueCategory = lvalue
# 1714| getExpr(): [TemporaryObjectExpr] temporary object
# 1714| Type = [Class] TrivialLambdaClass
# 1714| ValueCategory = prvalue(load)
# 1716| getStmt(2): [DeclStmt] declaration
# 1716| getDeclarationEntry(0): [VariableDeclarationEntry] definition of l_outer1
# 1716| Type = [Closure,LocalClass] decltype([...](...){...})
@@ -13477,7 +13480,7 @@ ir.cpp:
# 1726| getExpr(): [AssignExpr] ... = ...
# 1726| Type = [IntType] int
# 1726| ValueCategory = lvalue
# 1726| getLValue(): [PointerFieldAccess] x
# 1726| getLValue(): [ImplicitThisFieldAccess,PointerFieldAccess] x
# 1726| Type = [IntType] int
# 1726| ValueCategory = lvalue
# 1726| getQualifier(): [ThisExpr] this
@@ -14710,7 +14713,7 @@ ir.cpp:
# 1930| ValueCategory = lvalue
# 1930| getRValue(): [AssignExpr] ... = ...
# 1930| Type = [IntType] int
# 1930| ValueCategory = prvalue
# 1930| ValueCategory = prvalue(load)
# 1930| getLValue(): [VariableAccess] j
# 1930| Type = [IntType] int
# 1930| ValueCategory = lvalue
@@ -14741,7 +14744,7 @@ ir.cpp:
# 1935| ValueCategory = lvalue
# 1935| getRValue(): [AssignAddExpr] ... += ...
# 1935| Type = [IntType] int
# 1935| ValueCategory = prvalue
# 1935| ValueCategory = prvalue(load)
# 1935| getLValue(): [VariableAccess] j
# 1935| Type = [IntType] int
# 1935| ValueCategory = lvalue
@@ -14751,7 +14754,7 @@ ir.cpp:
# 1935| ValueCategory = prvalue
# 1935| getRValue().getFullyConverted(): [ParenthesisExpr] (...)
# 1935| Type = [IntType] int
# 1935| ValueCategory = prvalue
# 1935| ValueCategory = prvalue(load)
# 1936| getStmt(2): [ReturnStmt] return ...
# 1938| [CopyAssignmentOperator] D& D::operator=(D const&)
# 1938| <params>:
@@ -15040,7 +15043,7 @@ ir.cpp:
# 1993| ValueCategory = lvalue
# 1993| getRValue(): [FunctionAccess] StaticMemberFunction
# 1993| Type = [FunctionPointerType] ..(*)(..)
# 1993| ValueCategory = prvalue
# 1993| ValueCategory = prvalue(load)
# 1993| getQualifier(): [VariableAccess] c
# 1993| Type = [Class] C
# 1993| ValueCategory = lvalue
@@ -15065,7 +15068,7 @@ ir.cpp:
# 1997| ValueCategory = lvalue
# 1997| getRValue(): [ConditionalExpr] ... ? ... : ...
# 1997| Type = [IntType] int
# 1997| ValueCategory = prvalue
# 1997| ValueCategory = prvalue(load)
# 1997| getCondition(): [VariableAccess] a
# 1997| Type = [BoolType] bool
# 1997| ValueCategory = prvalue(load)
@@ -15084,7 +15087,7 @@ ir.cpp:
# 1998| ValueCategory = lvalue
# 1998| getRValue(): [ConditionalExpr] ... ? ... : ...
# 1998| Type = [IntType] int
# 1998| ValueCategory = prvalue
# 1998| ValueCategory = prvalue(load)
# 1998| getCondition(): [VariableAccess] a
# 1998| Type = [BoolType] bool
# 1998| ValueCategory = prvalue(load)
@@ -15168,7 +15171,7 @@ ir.cpp:
# 2007| ValueCategory = lvalue
# 2007| getRValue(): [ConditionalExpr] ... ? ... : ...
# 2007| Type = [Struct] TernaryPodObj
# 2007| ValueCategory = prvalue
# 2007| ValueCategory = prvalue(load)
# 2007| getCondition(): [VariableAccess] a
# 2007| Type = [BoolType] bool
# 2007| ValueCategory = prvalue(load)
@@ -15249,7 +15252,7 @@ ir.cpp:
# 2010| ValueCategory = lvalue
# 2010| getRValue(): [ConditionalExpr] ... ? ... : ...
# 2010| Type = [Struct] TernaryPodObj
# 2010| ValueCategory = prvalue
# 2010| ValueCategory = prvalue(load)
# 2010| getCondition(): [VariableAccess] a
# 2010| Type = [BoolType] bool
# 2010| ValueCategory = prvalue(load)
@@ -15501,7 +15504,7 @@ ir.cpp:
# 2028| ValueCategory = lvalue
# 2028| getRValue(): [ConditionalExpr] ... ? ... : ...
# 2028| Type = [IntType] unsigned int
# 2028| ValueCategory = prvalue
# 2028| ValueCategory = prvalue(load)
# 2028| getCondition(): [LTExpr] ... < ...
# 2028| Type = [BoolType] bool
# 2028| ValueCategory = prvalue
@@ -15519,7 +15522,7 @@ ir.cpp:
# 2028| ValueCategory = prvalue
# 2029| getThen(): [CommaExpr] ... , ...
# 2029| Type = [IntType] unsigned int
# 2029| ValueCategory = prvalue
# 2029| ValueCategory = prvalue(load)
# 2029| getLeftOperand(): [FunctionCall] call to CommaTestHelper
# 2029| Type = [VoidType] void
# 2029| ValueCategory = prvalue
@@ -15544,7 +15547,7 @@ ir.cpp:
# 2030| ValueCategory = prvalue
# 2029| getThen().getFullyConverted(): [ParenthesisExpr] (...)
# 2029| Type = [IntType] unsigned int
# 2029| ValueCategory = prvalue
# 2029| ValueCategory = prvalue(load)
# 2030| getElse().getFullyConverted(): [CStyleCast] (unsigned int)...
# 2030| Conversion = [IntegralConversion] integral conversion
# 2030| Type = [IntType] unsigned int
@@ -15935,6 +15938,44 @@ ir.cpp:
# 2104| Type = [CTypedefType,Size_t] size_t
# 2104| ValueCategory = prvalue(load)
# 2105| getStmt(6): [ReturnStmt] return ...
# 2107| [TopLevelFunction] double strtod(char const*, char**)
# 2107| <params>:
# 2107| getParameter(0): [Parameter] str
# 2107| Type = [PointerType] const char *
# 2107| getParameter(1): [Parameter] endptr
# 2107| Type = [PointerType] char **
# 2109| [TopLevelFunction] char* test_strtod(char*)
# 2109| <params>:
# 2109| getParameter(0): [Parameter] s
# 2109| Type = [CharPointerType] char *
# 2109| getEntryPoint(): [BlockStmt] { ... }
# 2110| getStmt(0): [DeclStmt] declaration
# 2110| getDeclarationEntry(0): [VariableDeclarationEntry] definition of end
# 2110| Type = [CharPointerType] char *
# 2111| getStmt(1): [DeclStmt] declaration
# 2111| getDeclarationEntry(0): [VariableDeclarationEntry] definition of d
# 2111| Type = [DoubleType] double
# 2111| getVariable().getInitializer(): [Initializer] initializer for d
# 2111| getExpr(): [FunctionCall] call to strtod
# 2111| Type = [DoubleType] double
# 2111| ValueCategory = prvalue
# 2111| getArgument(0): [VariableAccess] s
# 2111| Type = [CharPointerType] char *
# 2111| ValueCategory = prvalue(load)
# 2111| getArgument(1): [AddressOfExpr] & ...
# 2111| Type = [PointerType] char **
# 2111| ValueCategory = prvalue
# 2111| getOperand(): [VariableAccess] end
# 2111| Type = [CharPointerType] char *
# 2111| ValueCategory = lvalue
# 2111| getArgument(0).getFullyConverted(): [CStyleCast] (const char *)...
# 2111| Conversion = [PointerConversion] pointer conversion
# 2111| Type = [PointerType] const char *
# 2111| ValueCategory = prvalue
# 2112| getStmt(2): [ReturnStmt] return ...
# 2112| getExpr(): [VariableAccess] end
# 2112| Type = [CharPointerType] char *
# 2112| ValueCategory = prvalue(load)
perf-regression.cpp:
# 4| [CopyAssignmentOperator] Big& Big::operator=(Big const&)
# 4| <params>:

View File

@@ -765,7 +765,7 @@ ir.c:
# 9| r9_6(glval<int>) = FieldAddress[y] : r9_5
# 9| m9_7(int) = Store[?] : &:r9_6, r9_4
# 9| m9_8((unnamed class/struct/union)) = Chi : total:m8_10, partial:m9_7
# 9| r9_9(int) = CopyValue : r9_4
# 9| r9_9(int) = Load[?] : &:r9_6, m9_7
# 9| r9_10(glval<(unnamed class/struct/union)>) = VariableAddress[coords] :
# 9| r9_11(glval<int>) = FieldAddress[x] : r9_10
# 9| m9_12(int) = Store[?] : &:r9_11, r9_9
@@ -1187,15 +1187,17 @@ ir.cpp:
# 101| r101_3(int) = Constant[1] :
# 101| r101_4(int) = Add : r101_2, r101_3
# 101| m101_5(int) = Store[x] : &:r101_1, r101_4
# 101| r101_6(glval<int>) = VariableAddress[y] :
# 101| m101_7(int) = Store[y] : &:r101_6, r101_4
# 101| r101_6(int) = Load[x] : &:r101_1, m101_5
# 101| r101_7(glval<int>) = VariableAddress[y] :
# 101| m101_8(int) = Store[y] : &:r101_7, r101_6
# 102| r102_1(glval<int>) = VariableAddress[x] :
# 102| r102_2(int) = Load[x] : &:r102_1, m101_5
# 102| r102_3(int) = Constant[1] :
# 102| r102_4(int) = Sub : r102_2, r102_3
# 102| m102_5(int) = Store[x] : &:r102_1, r102_4
# 102| r102_6(glval<int>) = VariableAddress[y] :
# 102| m102_7(int) = Store[y] : &:r102_6, r102_4
# 102| r102_6(int) = Load[x] : &:r102_1, m102_5
# 102| r102_7(glval<int>) = VariableAddress[y] :
# 102| m102_8(int) = Store[y] : &:r102_7, r102_6
# 103| r103_1(glval<int>) = VariableAddress[x] :
# 103| r103_2(int) = Load[x] : &:r103_1, m102_5
# 103| r103_3(int) = Constant[1] :
@@ -1407,15 +1409,17 @@ ir.cpp:
# 147| r147_3(float) = Constant[1.0] :
# 147| r147_4(float) = Add : r147_2, r147_3
# 147| m147_5(float) = Store[x] : &:r147_1, r147_4
# 147| r147_6(glval<float>) = VariableAddress[y] :
# 147| m147_7(float) = Store[y] : &:r147_6, r147_4
# 147| r147_6(float) = Load[x] : &:r147_1, m147_5
# 147| r147_7(glval<float>) = VariableAddress[y] :
# 147| m147_8(float) = Store[y] : &:r147_7, r147_6
# 148| r148_1(glval<float>) = VariableAddress[x] :
# 148| r148_2(float) = Load[x] : &:r148_1, m147_5
# 148| r148_3(float) = Constant[1.0] :
# 148| r148_4(float) = Sub : r148_2, r148_3
# 148| m148_5(float) = Store[x] : &:r148_1, r148_4
# 148| r148_6(glval<float>) = VariableAddress[y] :
# 148| m148_7(float) = Store[y] : &:r148_6, r148_4
# 148| r148_6(float) = Load[x] : &:r148_1, m148_5
# 148| r148_7(glval<float>) = VariableAddress[y] :
# 148| m148_8(float) = Store[y] : &:r148_7, r148_6
# 149| r149_1(glval<float>) = VariableAddress[x] :
# 149| r149_2(float) = Load[x] : &:r149_1, m148_5
# 149| r149_3(float) = Constant[1.0] :
@@ -1723,15 +1727,17 @@ ir.cpp:
# 207| r207_3(int) = Constant[1] :
# 207| r207_4(int *) = PointerAdd[4] : r207_2, r207_3
# 207| m207_5(int *) = Store[p] : &:r207_1, r207_4
# 207| r207_6(glval<int *>) = VariableAddress[q] :
# 207| m207_7(int *) = Store[q] : &:r207_6, r207_4
# 207| r207_6(int *) = Load[p] : &:r207_1, m207_5
# 207| r207_7(glval<int *>) = VariableAddress[q] :
# 207| m207_8(int *) = Store[q] : &:r207_7, r207_6
# 208| r208_1(glval<int *>) = VariableAddress[p] :
# 208| r208_2(int *) = Load[p] : &:r208_1, m207_5
# 208| r208_3(int) = Constant[1] :
# 208| r208_4(int *) = PointerSub[4] : r208_2, r208_3
# 208| m208_5(int *) = Store[p] : &:r208_1, r208_4
# 208| r208_6(glval<int *>) = VariableAddress[q] :
# 208| m208_7(int *) = Store[q] : &:r208_6, r208_4
# 208| r208_6(int *) = Load[p] : &:r208_1, m208_5
# 208| r208_7(glval<int *>) = VariableAddress[q] :
# 208| m208_8(int *) = Store[q] : &:r208_7, r208_6
# 209| r209_1(glval<int *>) = VariableAddress[p] :
# 209| r209_2(int *) = Load[p] : &:r209_1, m208_5
# 209| r209_3(int) = Constant[1] :
@@ -6049,6 +6055,27 @@ ir.cpp:
# 1038| v1038_10(void) = AliasedUse : ~m1038_8
# 1038| v1038_11(void) = ExitFunction :
# 1038| void (lambda [] type at line 1038, col. 12)::(unnamed constructor)((lambda [] type at line 1038, col. 12)&&)
# 1038| Block 0
# 1038| v1038_1(void) = EnterFunction :
# 1038| m1038_2(unknown) = AliasedDefinition :
# 1038| m1038_3(unknown) = InitializeNonLocal :
# 1038| m1038_4(unknown) = Chi : total:m1038_2, partial:m1038_3
# 1038| r1038_5(glval<unknown>) = VariableAddress[#this] :
# 1038| m1038_6(glval<decltype([...](...){...})>) = InitializeParameter[#this] : &:r1038_5
# 1038| r1038_7(glval<decltype([...](...){...})>) = Load[#this] : &:r1038_5, m1038_6
# 1038| m1038_8(decltype([...](...){...})) = InitializeIndirection[#this] : &:r1038_7
#-----| r0_1(glval<lambda [] type at line 1038, col. 12 &&>) = VariableAddress[(unnamed parameter 0)] :
#-----| m0_2(lambda [] type at line 1038, col. 12 &&) = InitializeParameter[(unnamed parameter 0)] : &:r0_1
#-----| r0_3(lambda [] type at line 1038, col. 12 &&) = Load[(unnamed parameter 0)] : &:r0_1, m0_2
#-----| m0_4(unknown) = InitializeIndirection[(unnamed parameter 0)] : &:r0_3
# 1038| v1038_9(void) = NoOp :
# 1038| v1038_10(void) = ReturnIndirection[#this] : &:r1038_7, m1038_8
#-----| v0_5(void) = ReturnIndirection[(unnamed parameter 0)] : &:r0_3, m0_4
# 1038| v1038_11(void) = ReturnVoid :
# 1038| v1038_12(void) = AliasedUse : m1038_3
# 1038| v1038_13(void) = ExitFunction :
# 1038| void (lambda [] type at line 1038, col. 12)::operator()() const
# 1038| Block 0
# 1038| v1038_1(void) = EnterFunction :
@@ -6265,6 +6292,27 @@ ir.cpp:
# 1040| v1040_13(void) = AliasedUse : ~m1055_7
# 1040| v1040_14(void) = ExitFunction :
# 1041| void (void Lambda(int, String const&))::(lambda [] type at line 1041, col. 23)::(unnamed constructor)((void Lambda(int, String const&))::(lambda [] type at line 1041, col. 23)&&)
# 1041| Block 0
# 1041| v1041_1(void) = EnterFunction :
# 1041| m1041_2(unknown) = AliasedDefinition :
# 1041| m1041_3(unknown) = InitializeNonLocal :
# 1041| m1041_4(unknown) = Chi : total:m1041_2, partial:m1041_3
# 1041| r1041_5(glval<unknown>) = VariableAddress[#this] :
# 1041| m1041_6(glval<decltype([...](...){...})>) = InitializeParameter[#this] : &:r1041_5
# 1041| r1041_7(glval<decltype([...](...){...})>) = Load[#this] : &:r1041_5, m1041_6
# 1041| m1041_8(decltype([...](...){...})) = InitializeIndirection[#this] : &:r1041_7
#-----| r0_1(glval<lambda [] type at line 1041, col. 23 &&>) = VariableAddress[(unnamed parameter 0)] :
#-----| m0_2(lambda [] type at line 1041, col. 23 &&) = InitializeParameter[(unnamed parameter 0)] : &:r0_1
#-----| r0_3(lambda [] type at line 1041, col. 23 &&) = Load[(unnamed parameter 0)] : &:r0_1, m0_2
#-----| m0_4(unknown) = InitializeIndirection[(unnamed parameter 0)] : &:r0_3
# 1041| v1041_9(void) = NoOp :
# 1041| v1041_10(void) = ReturnIndirection[#this] : &:r1041_7, m1041_8
#-----| v0_5(void) = ReturnIndirection[(unnamed parameter 0)] : &:r0_3, m0_4
# 1041| v1041_11(void) = ReturnVoid :
# 1041| v1041_12(void) = AliasedUse : m1041_3
# 1041| v1041_13(void) = ExitFunction :
# 1041| char (void Lambda(int, String const&))::(lambda [] type at line 1041, col. 23)::operator()(float) const
# 1041| Block 0
# 1041| v1041_1(void) = EnterFunction :
@@ -8156,7 +8204,6 @@ ir.cpp:
# 1376| m1376_4(unknown) = ^CallSideEffect : ~m1374_11
# 1376| m1376_5(unknown) = Chi : total:m1374_11, partial:m1376_4
# 1376| m1376_6(String) = Store[#temp1376:5] : &:r1376_1, r1376_3
# 1376| r1376_7(String) = Load[#temp1376:5] : &:r1376_1, m1376_6
# 1377| v1377_1(void) = NoOp :
# 1365| v1365_5(void) = ReturnVoid :
# 1365| v1365_6(void) = AliasedUse : ~m1376_5
@@ -8232,7 +8279,6 @@ ir.cpp:
# 1388| m1388_4(unknown) = ^CallSideEffect : ~m1386_10
# 1388| m1388_5(unknown) = Chi : total:m1386_10, partial:m1388_4
# 1388| m1388_6(destructor_only) = Store[#temp1388:5] : &:r1388_1, r1388_3
# 1388| r1388_7(destructor_only) = Load[#temp1388:5] : &:r1388_1, m1388_6
# 1389| v1389_1(void) = NoOp :
# 1379| v1379_5(void) = ReturnVoid :
# 1379| v1379_6(void) = AliasedUse : ~m1388_5
@@ -8327,7 +8373,6 @@ ir.cpp:
# 1399| m1399_4(unknown) = ^CallSideEffect : ~m1398_10
# 1399| m1399_5(unknown) = Chi : total:m1398_10, partial:m1399_4
# 1399| m1399_6(copy_constructor) = Store[#temp1399:5] : &:r1399_1, r1399_3
# 1399| r1399_7(copy_constructor) = Load[#temp1399:5] : &:r1399_1, m1399_6
# 1401| r1401_1(glval<int>) = VariableAddress[y] :
# 1401| r1401_2(glval<copy_constructor>) = VariableAddress[#temp1401:13] :
# 1401| r1401_3(glval<unknown>) = FunctionAddress[returnValue] :
@@ -9841,14 +9886,11 @@ ir.cpp:
# 1713| m1713_2(TrivialLambdaClass) = Uninitialized[l1] : &:r1713_1
# 1714| r1714_1(glval<TrivialLambdaClass &>) = VariableAddress[l2] :
# 1714| r1714_2(glval<TrivialLambdaClass>) = VariableAddress[#temp1714:36] :
# 1714| r1714_3(glval<TrivialLambdaClass>) = VariableAddress[#temp1714:36] :
# 1714| r1714_4(TrivialLambdaClass) = Constant[0] :
# 1714| m1714_5(TrivialLambdaClass) = Store[#temp1714:36] : &:r1714_3, r1714_4
# 1714| r1714_6(TrivialLambdaClass) = Load[#temp1714:36] : &:r1714_3, m1714_5
# 1714| m1714_7(TrivialLambdaClass) = Store[#temp1714:36] : &:r1714_2, r1714_6
# 1714| r1714_8(glval<TrivialLambdaClass>) = Convert : r1714_2
# 1714| r1714_9(TrivialLambdaClass &) = CopyValue : r1714_8
# 1714| m1714_10(TrivialLambdaClass &) = Store[l2] : &:r1714_1, r1714_9
# 1714| r1714_3(TrivialLambdaClass) = Constant[0] :
# 1714| m1714_4(TrivialLambdaClass) = Store[#temp1714:36] : &:r1714_2, r1714_3
# 1714| r1714_5(glval<TrivialLambdaClass>) = Convert : r1714_2
# 1714| r1714_6(TrivialLambdaClass &) = CopyValue : r1714_5
# 1714| m1714_7(TrivialLambdaClass &) = Store[l2] : &:r1714_1, r1714_6
# 1716| r1716_1(glval<decltype([...](...){...})>) = VariableAddress[l_outer1] :
# 1716| r1716_2(glval<decltype([...](...){...})>) = VariableAddress[#temp1716:20] :
# 1716| m1716_3(decltype([...](...){...})) = Uninitialized[#temp1716:20] : &:r1716_2
@@ -9876,8 +9918,8 @@ ir.cpp:
# 1716| m1716_19(decltype([...](...){...})) = Chi : total:m0_6, partial:m1716_18
# 1716| r1716_20(glval<TrivialLambdaClass>) = FieldAddress[l2] : r1716_2
# 1716| r1716_21(glval<TrivialLambdaClass &>) = VariableAddress[l2] :
# 1716| r1716_22(TrivialLambdaClass &) = Load[l2] : &:r1716_21, m1714_10
#-----| r0_7(TrivialLambdaClass) = Load[?] : &:r1716_22, m1714_7
# 1716| r1716_22(TrivialLambdaClass &) = Load[l2] : &:r1716_21, m1714_7
#-----| r0_7(TrivialLambdaClass) = Load[?] : &:r1716_22, m1714_4
#-----| m0_8(TrivialLambdaClass) = Store[?] : &:r1716_20, r0_7
#-----| m0_9(decltype([...](...){...})) = Chi : total:m1716_19, partial:m0_8
# 1716| r1716_23(decltype([...](...){...})) = Load[#temp1716:20] : &:r1716_2, m0_9
@@ -11011,7 +11053,7 @@ ir.cpp:
# 1930| r1930_1(int) = Constant[40] :
# 1930| r1930_2(glval<int>) = VariableAddress[j] :
# 1930| m1930_3(int) = Store[j] : &:r1930_2, r1930_1
# 1930| r1930_4(int) = CopyValue : r1930_1
# 1930| r1930_4(int) = Load[j] : &:r1930_2, m1930_3
# 1930| r1930_5(glval<int>) = VariableAddress[i] :
# 1930| m1930_6(int) = Store[i] : &:r1930_5, r1930_4
# 1931| v1931_1(void) = NoOp :
@@ -11035,8 +11077,9 @@ ir.cpp:
# 1935| r1935_3(int) = Load[j] : &:r1935_2, m1934_5
# 1935| r1935_4(int) = Add : r1935_3, r1935_1
# 1935| m1935_5(int) = Store[j] : &:r1935_2, r1935_4
# 1935| r1935_6(glval<int>) = VariableAddress[i] :
# 1935| m1935_7(int) = Store[i] : &:r1935_6, r1935_4
# 1935| r1935_6(int) = Load[j] : &:r1935_2, m1935_5
# 1935| r1935_7(glval<int>) = VariableAddress[i] :
# 1935| m1935_8(int) = Store[i] : &:r1935_7, r1935_6
# 1936| v1936_1(void) = NoOp :
# 1933| v1933_5(void) = ReturnVoid :
# 1933| v1933_6(void) = AliasedUse : m1933_3
@@ -12290,6 +12333,40 @@ ir.cpp:
# 2098| v2098_8(void) = AliasedUse : ~m2104_8
# 2098| v2098_9(void) = ExitFunction :
# 2109| char* test_strtod(char*)
# 2109| Block 0
# 2109| v2109_1(void) = EnterFunction :
# 2109| m2109_2(unknown) = AliasedDefinition :
# 2109| m2109_3(unknown) = InitializeNonLocal :
# 2109| m2109_4(unknown) = Chi : total:m2109_2, partial:m2109_3
# 2109| r2109_5(glval<char *>) = VariableAddress[s] :
# 2109| m2109_6(char *) = InitializeParameter[s] : &:r2109_5
# 2109| r2109_7(char *) = Load[s] : &:r2109_5, m2109_6
# 2109| m2109_8(unknown) = InitializeIndirection[s] : &:r2109_7
# 2110| r2110_1(glval<char *>) = VariableAddress[end] :
# 2110| m2110_2(char *) = Uninitialized[end] : &:r2110_1
# 2111| r2111_1(glval<double>) = VariableAddress[d] :
# 2111| r2111_2(glval<unknown>) = FunctionAddress[strtod] :
# 2111| r2111_3(glval<char *>) = VariableAddress[s] :
# 2111| r2111_4(char *) = Load[s] : &:r2111_3, m2109_6
# 2111| r2111_5(char *) = Convert : r2111_4
# 2111| r2111_6(glval<char *>) = VariableAddress[end] :
# 2111| r2111_7(char **) = CopyValue : r2111_6
# 2111| r2111_8(double) = Call[strtod] : func:r2111_2, 0:r2111_5, 1:r2111_7
# 2111| v2111_9(void) = ^BufferReadSideEffect[0] : &:r2111_5, ~m2109_8
# 2111| m2111_10(char *) = ^IndirectMayWriteSideEffect[1] : &:r2111_7
# 2111| m2111_11(char *) = Chi : total:m2110_2, partial:m2111_10
# 2111| m2111_12(double) = Store[d] : &:r2111_1, r2111_8
# 2112| r2112_1(glval<char *>) = VariableAddress[#return] :
# 2112| r2112_2(glval<char *>) = VariableAddress[end] :
# 2112| r2112_3(char *) = Load[end] : &:r2112_2, m2111_11
# 2112| m2112_4(char *) = Store[#return] : &:r2112_1, r2112_3
# 2109| v2109_9(void) = ReturnIndirection[s] : &:r2109_7, m2109_8
# 2109| r2109_10(glval<char *>) = VariableAddress[#return] :
# 2109| v2109_11(void) = ReturnValue : &:r2109_10, m2112_4
# 2109| v2109_12(void) = AliasedUse : m2109_3
# 2109| v2109_13(void) = ExitFunction :
perf-regression.cpp:
# 6| void Big::Big()
# 6| Block 0

View File

@@ -2104,4 +2104,12 @@ void newArrayCorrectType(size_t n) {
new int[n] { 0, 1, 2 };
}
double strtod (const char* str, char** endptr);
char* test_strtod(char *s) {
char *end;
double d = strtod(s, &end);
return end;
}
// semmle-extractor-options: -std=c++17 --clang

View File

@@ -684,6 +684,10 @@
| file://:0:0:0:0 | Address | &:r0_1 |
| file://:0:0:0:0 | Address | &:r0_1 |
| file://:0:0:0:0 | Address | &:r0_1 |
| file://:0:0:0:0 | Address | &:r0_1 |
| file://:0:0:0:0 | Address | &:r0_1 |
| file://:0:0:0:0 | Address | &:r0_1 |
| file://:0:0:0:0 | Address | &:r0_1 |
| file://:0:0:0:0 | Address | &:r0_2 |
| file://:0:0:0:0 | Address | &:r0_3 |
| file://:0:0:0:0 | Address | &:r0_3 |
@@ -712,6 +716,10 @@
| file://:0:0:0:0 | Address | &:r0_3 |
| file://:0:0:0:0 | Address | &:r0_3 |
| file://:0:0:0:0 | Address | &:r0_3 |
| file://:0:0:0:0 | Address | &:r0_3 |
| file://:0:0:0:0 | Address | &:r0_3 |
| file://:0:0:0:0 | Address | &:r0_3 |
| file://:0:0:0:0 | Address | &:r0_3 |
| file://:0:0:0:0 | Address | &:r0_4 |
| file://:0:0:0:0 | Address | &:r0_4 |
| file://:0:0:0:0 | Address | &:r0_5 |
@@ -811,6 +819,8 @@
| file://:0:0:0:0 | Load | m0_2 |
| file://:0:0:0:0 | Load | m0_2 |
| file://:0:0:0:0 | Load | m0_2 |
| file://:0:0:0:0 | Load | m0_2 |
| file://:0:0:0:0 | Load | m0_2 |
| file://:0:0:0:0 | Load | m0_5 |
| file://:0:0:0:0 | Load | m0_8 |
| file://:0:0:0:0 | Load | m0_11 |
@@ -822,7 +832,7 @@
| file://:0:0:0:0 | Load | m1466_4 |
| file://:0:0:0:0 | Load | m1466_4 |
| file://:0:0:0:0 | Load | m1685_9 |
| file://:0:0:0:0 | Load | m1714_7 |
| file://:0:0:0:0 | Load | m1714_4 |
| file://:0:0:0:0 | Load | m1834_6 |
| file://:0:0:0:0 | Load | m1834_6 |
| file://:0:0:0:0 | Load | m1839_6 |
@@ -847,6 +857,8 @@
| file://:0:0:0:0 | SideEffect | m0_4 |
| file://:0:0:0:0 | SideEffect | m0_4 |
| file://:0:0:0:0 | SideEffect | m0_4 |
| file://:0:0:0:0 | SideEffect | m0_4 |
| file://:0:0:0:0 | SideEffect | m0_4 |
| file://:0:0:0:0 | SideEffect | m0_14 |
| file://:0:0:0:0 | SideEffect | m1078_23 |
| file://:0:0:0:0 | SideEffect | m1078_23 |
@@ -954,13 +966,14 @@
| ir.c:9:14:9:19 | Unary | r9_5 |
| ir.c:9:14:9:31 | ChiPartial | partial:m9_7 |
| ir.c:9:14:9:31 | ChiTotal | total:m8_10 |
| ir.c:9:14:9:31 | Load | m9_7 |
| ir.c:9:14:9:31 | StoreValue | r9_9 |
| ir.c:9:21:9:21 | Address | &:r9_6 |
| ir.c:9:21:9:21 | Address | &:r9_6 |
| ir.c:9:25:9:27 | Address | &:r9_1 |
| ir.c:9:25:9:27 | Left | r9_2 |
| ir.c:9:25:9:27 | Load | m7_6 |
| ir.c:9:25:9:31 | StoreValue | r9_4 |
| ir.c:9:25:9:31 | Unary | r9_4 |
| ir.c:9:31:9:31 | Right | r9_3 |
| ir.c:10:3:10:8 | Unary | r10_10 |
| ir.c:10:3:10:26 | ChiPartial | partial:m10_12 |
@@ -1329,18 +1342,22 @@
| ir.cpp:98:6:98:19 | SideEffect | m98_3 |
| ir.cpp:98:25:98:25 | Address | &:r98_5 |
| ir.cpp:99:9:99:9 | Address | &:r99_1 |
| ir.cpp:101:5:101:5 | Address | &:r101_6 |
| ir.cpp:101:5:101:5 | Address | &:r101_7 |
| ir.cpp:101:9:101:11 | Load | m101_5 |
| ir.cpp:101:9:101:11 | Right | r101_3 |
| ir.cpp:101:9:101:11 | StoreValue | r101_4 |
| ir.cpp:101:9:101:11 | StoreValue | r101_4 |
| ir.cpp:101:9:101:11 | StoreValue | r101_6 |
| ir.cpp:101:11:101:11 | Address | &:r101_1 |
| ir.cpp:101:11:101:11 | Address | &:r101_1 |
| ir.cpp:101:11:101:11 | Address | &:r101_1 |
| ir.cpp:101:11:101:11 | Left | r101_2 |
| ir.cpp:101:11:101:11 | Load | m98_6 |
| ir.cpp:102:5:102:5 | Address | &:r102_6 |
| ir.cpp:102:5:102:5 | Address | &:r102_7 |
| ir.cpp:102:9:102:11 | Load | m102_5 |
| ir.cpp:102:9:102:11 | Right | r102_3 |
| ir.cpp:102:9:102:11 | StoreValue | r102_4 |
| ir.cpp:102:9:102:11 | StoreValue | r102_4 |
| ir.cpp:102:9:102:11 | StoreValue | r102_6 |
| ir.cpp:102:11:102:11 | Address | &:r102_1 |
| ir.cpp:102:11:102:11 | Address | &:r102_1 |
| ir.cpp:102:11:102:11 | Address | &:r102_1 |
| ir.cpp:102:11:102:11 | Left | r102_2 |
@@ -1531,18 +1548,22 @@
| ir.cpp:144:6:144:17 | SideEffect | m144_3 |
| ir.cpp:144:25:144:25 | Address | &:r144_5 |
| ir.cpp:145:11:145:11 | Address | &:r145_1 |
| ir.cpp:147:5:147:5 | Address | &:r147_6 |
| ir.cpp:147:5:147:5 | Address | &:r147_7 |
| ir.cpp:147:9:147:11 | Load | m147_5 |
| ir.cpp:147:9:147:11 | Right | r147_3 |
| ir.cpp:147:9:147:11 | StoreValue | r147_4 |
| ir.cpp:147:9:147:11 | StoreValue | r147_4 |
| ir.cpp:147:9:147:11 | StoreValue | r147_6 |
| ir.cpp:147:11:147:11 | Address | &:r147_1 |
| ir.cpp:147:11:147:11 | Address | &:r147_1 |
| ir.cpp:147:11:147:11 | Address | &:r147_1 |
| ir.cpp:147:11:147:11 | Left | r147_2 |
| ir.cpp:147:11:147:11 | Load | m144_6 |
| ir.cpp:148:5:148:5 | Address | &:r148_6 |
| ir.cpp:148:5:148:5 | Address | &:r148_7 |
| ir.cpp:148:9:148:11 | Load | m148_5 |
| ir.cpp:148:9:148:11 | Right | r148_3 |
| ir.cpp:148:9:148:11 | StoreValue | r148_4 |
| ir.cpp:148:9:148:11 | StoreValue | r148_4 |
| ir.cpp:148:9:148:11 | StoreValue | r148_6 |
| ir.cpp:148:11:148:11 | Address | &:r148_1 |
| ir.cpp:148:11:148:11 | Address | &:r148_1 |
| ir.cpp:148:11:148:11 | Address | &:r148_1 |
| ir.cpp:148:11:148:11 | Left | r148_2 |
@@ -1840,18 +1861,22 @@
| ir.cpp:204:26:204:26 | Load | m204_6 |
| ir.cpp:204:26:204:26 | SideEffect | m204_8 |
| ir.cpp:205:10:205:10 | Address | &:r205_1 |
| ir.cpp:207:5:207:5 | Address | &:r207_6 |
| ir.cpp:207:5:207:5 | Address | &:r207_7 |
| ir.cpp:207:9:207:11 | Load | m207_5 |
| ir.cpp:207:9:207:11 | Right | r207_3 |
| ir.cpp:207:9:207:11 | StoreValue | r207_4 |
| ir.cpp:207:9:207:11 | StoreValue | r207_4 |
| ir.cpp:207:9:207:11 | StoreValue | r207_6 |
| ir.cpp:207:11:207:11 | Address | &:r207_1 |
| ir.cpp:207:11:207:11 | Address | &:r207_1 |
| ir.cpp:207:11:207:11 | Address | &:r207_1 |
| ir.cpp:207:11:207:11 | Left | r207_2 |
| ir.cpp:207:11:207:11 | Load | m204_6 |
| ir.cpp:208:5:208:5 | Address | &:r208_6 |
| ir.cpp:208:5:208:5 | Address | &:r208_7 |
| ir.cpp:208:9:208:11 | Load | m208_5 |
| ir.cpp:208:9:208:11 | Right | r208_3 |
| ir.cpp:208:9:208:11 | StoreValue | r208_4 |
| ir.cpp:208:9:208:11 | StoreValue | r208_4 |
| ir.cpp:208:9:208:11 | StoreValue | r208_6 |
| ir.cpp:208:11:208:11 | Address | &:r208_1 |
| ir.cpp:208:11:208:11 | Address | &:r208_1 |
| ir.cpp:208:11:208:11 | Address | &:r208_1 |
| ir.cpp:208:11:208:11 | Left | r208_2 |
@@ -4947,6 +4972,15 @@
| ir.cpp:1035:15:1035:15 | Address | &:r1035_1 |
| ir.cpp:1038:6:1038:8 | Address | &:r1038_3 |
| ir.cpp:1038:6:1038:8 | SideEffect | ~m1038_8 |
| ir.cpp:1038:12:1038:12 | Address | &:r1038_5 |
| ir.cpp:1038:12:1038:12 | Address | &:r1038_5 |
| ir.cpp:1038:12:1038:12 | Address | &:r1038_7 |
| ir.cpp:1038:12:1038:12 | Address | &:r1038_7 |
| ir.cpp:1038:12:1038:12 | ChiPartial | partial:m1038_3 |
| ir.cpp:1038:12:1038:12 | ChiTotal | total:m1038_2 |
| ir.cpp:1038:12:1038:12 | Load | m1038_6 |
| ir.cpp:1038:12:1038:12 | SideEffect | m1038_3 |
| ir.cpp:1038:12:1038:12 | SideEffect | m1038_8 |
| ir.cpp:1038:12:1038:18 | Address | &:r1038_4 |
| ir.cpp:1038:12:1038:18 | Address | &:r1038_4 |
| ir.cpp:1038:12:1038:18 | ChiPartial | partial:m1038_7 |
@@ -4986,6 +5020,15 @@
| ir.cpp:1040:34:1040:34 | Load | m1040_8 |
| ir.cpp:1040:34:1040:34 | SideEffect | m1040_10 |
| ir.cpp:1041:8:1041:19 | Address | &:r1041_1 |
| ir.cpp:1041:23:1041:23 | Address | &:r1041_5 |
| ir.cpp:1041:23:1041:23 | Address | &:r1041_5 |
| ir.cpp:1041:23:1041:23 | Address | &:r1041_7 |
| ir.cpp:1041:23:1041:23 | Address | &:r1041_7 |
| ir.cpp:1041:23:1041:23 | ChiPartial | partial:m1041_3 |
| ir.cpp:1041:23:1041:23 | ChiTotal | total:m1041_2 |
| ir.cpp:1041:23:1041:23 | Load | m1041_6 |
| ir.cpp:1041:23:1041:23 | SideEffect | m1041_3 |
| ir.cpp:1041:23:1041:23 | SideEffect | m1041_8 |
| ir.cpp:1041:23:1041:49 | Address | &:r1041_2 |
| ir.cpp:1041:23:1041:49 | Address | &:r1041_2 |
| ir.cpp:1041:23:1041:49 | Load | m1041_3 |
@@ -6610,8 +6653,6 @@
| ir.cpp:1376:5:1376:28 | SideEffect | ~m1374_11 |
| ir.cpp:1376:5:1376:28 | StoreValue | r1376_3 |
| ir.cpp:1376:5:1376:30 | Address | &:r1376_1 |
| ir.cpp:1376:5:1376:30 | Address | &:r1376_1 |
| ir.cpp:1376:5:1376:30 | Load | m1376_6 |
| ir.cpp:1379:6:1379:30 | ChiPartial | partial:m1379_3 |
| ir.cpp:1379:6:1379:30 | ChiTotal | total:m1379_2 |
| ir.cpp:1379:6:1379:30 | SideEffect | ~m1388_5 |
@@ -6686,8 +6727,6 @@
| ir.cpp:1388:5:1388:37 | SideEffect | ~m1386_10 |
| ir.cpp:1388:5:1388:37 | StoreValue | r1388_3 |
| ir.cpp:1388:5:1388:39 | Address | &:r1388_1 |
| ir.cpp:1388:5:1388:39 | Address | &:r1388_1 |
| ir.cpp:1388:5:1388:39 | Load | m1388_6 |
| ir.cpp:1391:6:1391:31 | ChiPartial | partial:m1391_3 |
| ir.cpp:1391:6:1391:31 | ChiTotal | total:m1391_2 |
| ir.cpp:1391:6:1391:31 | SideEffect | ~m1401_6 |
@@ -6787,8 +6826,6 @@
| ir.cpp:1399:5:1399:38 | SideEffect | ~m1398_10 |
| ir.cpp:1399:5:1399:38 | StoreValue | r1399_3 |
| ir.cpp:1399:5:1399:40 | Address | &:r1399_1 |
| ir.cpp:1399:5:1399:40 | Address | &:r1399_1 |
| ir.cpp:1399:5:1399:40 | Load | m1399_6 |
| ir.cpp:1401:9:1401:9 | Address | &:r1401_1 |
| ir.cpp:1401:13:1401:41 | CallTarget | func:r1401_3 |
| ir.cpp:1401:13:1401:41 | ChiPartial | partial:m1401_5 |
@@ -8171,14 +8208,10 @@
| ir.cpp:1713:30:1713:31 | Address | &:r1713_1 |
| ir.cpp:1714:31:1714:32 | Address | &:r1714_1 |
| ir.cpp:1714:36:1714:55 | Address | &:r1714_2 |
| ir.cpp:1714:36:1714:55 | Address | &:r1714_3 |
| ir.cpp:1714:36:1714:55 | Address | &:r1714_3 |
| ir.cpp:1714:36:1714:55 | Load | m1714_5 |
| ir.cpp:1714:36:1714:55 | StoreValue | r1714_4 |
| ir.cpp:1714:36:1714:55 | StoreValue | r1714_3 |
| ir.cpp:1714:36:1714:55 | StoreValue | r1714_6 |
| ir.cpp:1714:36:1714:55 | StoreValue | r1714_9 |
| ir.cpp:1714:36:1714:55 | Unary | r1714_2 |
| ir.cpp:1714:36:1714:55 | Unary | r1714_8 |
| ir.cpp:1714:36:1714:55 | Unary | r1714_5 |
| ir.cpp:1716:10:1716:17 | Address | &:r1716_1 |
| ir.cpp:1716:20:1718:5 | Address | &:r1716_2 |
| ir.cpp:1716:20:1718:5 | Address | &:r1716_2 |
@@ -8204,7 +8237,7 @@
| ir.cpp:1716:20:1718:5 | Load | m1712_8 |
| ir.cpp:1716:20:1718:5 | Load | m1712_12 |
| ir.cpp:1716:20:1718:5 | Load | m1713_2 |
| ir.cpp:1716:20:1718:5 | Load | m1714_10 |
| ir.cpp:1716:20:1718:5 | Load | m1714_7 |
| ir.cpp:1716:20:1718:5 | StoreValue | r1716_6 |
| ir.cpp:1716:20:1718:5 | StoreValue | r1716_17 |
| ir.cpp:1716:20:1718:5 | StoreValue | r1716_23 |
@@ -9037,22 +9070,25 @@
| ir.cpp:1929:10:1929:10 | Address | &:r1929_3 |
| ir.cpp:1930:3:1930:3 | Address | &:r1930_5 |
| ir.cpp:1930:7:1930:7 | Address | &:r1930_2 |
| ir.cpp:1930:7:1930:7 | Address | &:r1930_2 |
| ir.cpp:1930:7:1930:12 | Load | m1930_3 |
| ir.cpp:1930:7:1930:12 | StoreValue | r1930_4 |
| ir.cpp:1930:11:1930:12 | StoreValue | r1930_1 |
| ir.cpp:1930:11:1930:12 | Unary | r1930_1 |
| ir.cpp:1933:6:1933:38 | ChiPartial | partial:m1933_3 |
| ir.cpp:1933:6:1933:38 | ChiTotal | total:m1933_2 |
| ir.cpp:1933:6:1933:38 | SideEffect | m1933_3 |
| ir.cpp:1934:7:1934:7 | Address | &:r1934_1 |
| ir.cpp:1934:10:1934:10 | Address | &:r1934_3 |
| ir.cpp:1934:13:1934:14 | StoreValue | r1934_4 |
| ir.cpp:1935:3:1935:3 | Address | &:r1935_6 |
| ir.cpp:1935:3:1935:3 | Address | &:r1935_7 |
| ir.cpp:1935:8:1935:8 | Address | &:r1935_2 |
| ir.cpp:1935:8:1935:8 | Address | &:r1935_2 |
| ir.cpp:1935:8:1935:8 | Address | &:r1935_2 |
| ir.cpp:1935:8:1935:8 | Left | r1935_3 |
| ir.cpp:1935:8:1935:8 | Load | m1934_5 |
| ir.cpp:1935:8:1935:14 | Load | m1935_5 |
| ir.cpp:1935:8:1935:14 | StoreValue | r1935_4 |
| ir.cpp:1935:8:1935:14 | StoreValue | r1935_4 |
| ir.cpp:1935:8:1935:14 | StoreValue | r1935_6 |
| ir.cpp:1935:13:1935:14 | Right | r1935_1 |
| ir.cpp:1942:15:1942:43 | Address | &:r1942_5 |
| ir.cpp:1942:15:1942:43 | ChiPartial | partial:m1942_3 |
@@ -9968,6 +10004,36 @@
| ir.cpp:2104:11:2104:11 | Address | &:r2104_2 |
| ir.cpp:2104:11:2104:11 | Left | r2104_3 |
| ir.cpp:2104:11:2104:11 | Load | m2098_6 |
| ir.cpp:2109:7:2109:17 | Address | &:r2109_10 |
| ir.cpp:2109:7:2109:17 | ChiPartial | partial:m2109_3 |
| ir.cpp:2109:7:2109:17 | ChiTotal | total:m2109_2 |
| ir.cpp:2109:7:2109:17 | Load | m2112_4 |
| ir.cpp:2109:7:2109:17 | SideEffect | m2109_3 |
| ir.cpp:2109:25:2109:25 | Address | &:r2109_5 |
| ir.cpp:2109:25:2109:25 | Address | &:r2109_5 |
| ir.cpp:2109:25:2109:25 | Address | &:r2109_7 |
| ir.cpp:2109:25:2109:25 | Address | &:r2109_7 |
| ir.cpp:2109:25:2109:25 | Load | m2109_6 |
| ir.cpp:2109:25:2109:25 | SideEffect | m2109_8 |
| ir.cpp:2110:9:2110:11 | Address | &:r2110_1 |
| ir.cpp:2111:10:2111:10 | Address | &:r2111_1 |
| ir.cpp:2111:14:2111:19 | CallTarget | func:r2111_2 |
| ir.cpp:2111:14:2111:19 | StoreValue | r2111_8 |
| ir.cpp:2111:21:2111:21 | Address | &:r2111_3 |
| ir.cpp:2111:21:2111:21 | Address | &:r2111_5 |
| ir.cpp:2111:21:2111:21 | Arg(0) | 0:r2111_5 |
| ir.cpp:2111:21:2111:21 | Load | m2109_6 |
| ir.cpp:2111:21:2111:21 | SideEffect | ~m2109_8 |
| ir.cpp:2111:21:2111:21 | Unary | r2111_4 |
| ir.cpp:2111:24:2111:27 | Address | &:r2111_7 |
| ir.cpp:2111:24:2111:27 | Arg(1) | 1:r2111_7 |
| ir.cpp:2111:24:2111:27 | ChiPartial | partial:m2111_10 |
| ir.cpp:2111:24:2111:27 | ChiTotal | total:m2110_2 |
| ir.cpp:2111:25:2111:27 | Unary | r2111_6 |
| ir.cpp:2112:3:2112:13 | Address | &:r2112_1 |
| ir.cpp:2112:10:2112:12 | Address | &:r2112_2 |
| ir.cpp:2112:10:2112:12 | Load | m2111_11 |
| ir.cpp:2112:10:2112:12 | StoreValue | r2112_3 |
| perf-regression.cpp:6:3:6:5 | Address | &:r6_5 |
| perf-regression.cpp:6:3:6:5 | Address | &:r6_5 |
| perf-regression.cpp:6:3:6:5 | Address | &:r6_7 |

View File

@@ -747,7 +747,7 @@ ir.c:
# 9| r9_5(glval<(unnamed class/struct/union)>) = VariableAddress[coords] :
# 9| r9_6(glval<int>) = FieldAddress[y] : r9_5
# 9| mu9_7(int) = Store[?] : &:r9_6, r9_4
# 9| r9_8(int) = CopyValue : r9_4
# 9| r9_8(int) = Load[?] : &:r9_6, ~m?
# 9| r9_9(glval<(unnamed class/struct/union)>) = VariableAddress[coords] :
# 9| r9_10(glval<int>) = FieldAddress[x] : r9_9
# 9| mu9_11(int) = Store[?] : &:r9_10, r9_8
@@ -1159,15 +1159,17 @@ ir.cpp:
# 101| r101_3(int) = Constant[1] :
# 101| r101_4(int) = Add : r101_2, r101_3
# 101| mu101_5(int) = Store[x] : &:r101_1, r101_4
# 101| r101_6(glval<int>) = VariableAddress[y] :
# 101| mu101_7(int) = Store[y] : &:r101_6, r101_4
# 101| r101_6(int) = Load[x] : &:r101_1, ~m?
# 101| r101_7(glval<int>) = VariableAddress[y] :
# 101| mu101_8(int) = Store[y] : &:r101_7, r101_6
# 102| r102_1(glval<int>) = VariableAddress[x] :
# 102| r102_2(int) = Load[x] : &:r102_1, ~m?
# 102| r102_3(int) = Constant[1] :
# 102| r102_4(int) = Sub : r102_2, r102_3
# 102| mu102_5(int) = Store[x] : &:r102_1, r102_4
# 102| r102_6(glval<int>) = VariableAddress[y] :
# 102| mu102_7(int) = Store[y] : &:r102_6, r102_4
# 102| r102_6(int) = Load[x] : &:r102_1, ~m?
# 102| r102_7(glval<int>) = VariableAddress[y] :
# 102| mu102_8(int) = Store[y] : &:r102_7, r102_6
# 103| r103_1(glval<int>) = VariableAddress[x] :
# 103| r103_2(int) = Load[x] : &:r103_1, ~m?
# 103| r103_3(int) = Constant[1] :
@@ -1375,15 +1377,17 @@ ir.cpp:
# 147| r147_3(float) = Constant[1.0] :
# 147| r147_4(float) = Add : r147_2, r147_3
# 147| mu147_5(float) = Store[x] : &:r147_1, r147_4
# 147| r147_6(glval<float>) = VariableAddress[y] :
# 147| mu147_7(float) = Store[y] : &:r147_6, r147_4
# 147| r147_6(float) = Load[x] : &:r147_1, ~m?
# 147| r147_7(glval<float>) = VariableAddress[y] :
# 147| mu147_8(float) = Store[y] : &:r147_7, r147_6
# 148| r148_1(glval<float>) = VariableAddress[x] :
# 148| r148_2(float) = Load[x] : &:r148_1, ~m?
# 148| r148_3(float) = Constant[1.0] :
# 148| r148_4(float) = Sub : r148_2, r148_3
# 148| mu148_5(float) = Store[x] : &:r148_1, r148_4
# 148| r148_6(glval<float>) = VariableAddress[y] :
# 148| mu148_7(float) = Store[y] : &:r148_6, r148_4
# 148| r148_6(float) = Load[x] : &:r148_1, ~m?
# 148| r148_7(glval<float>) = VariableAddress[y] :
# 148| mu148_8(float) = Store[y] : &:r148_7, r148_6
# 149| r149_1(glval<float>) = VariableAddress[x] :
# 149| r149_2(float) = Load[x] : &:r149_1, ~m?
# 149| r149_3(float) = Constant[1.0] :
@@ -1682,15 +1686,17 @@ ir.cpp:
# 207| r207_3(int) = Constant[1] :
# 207| r207_4(int *) = PointerAdd[4] : r207_2, r207_3
# 207| mu207_5(int *) = Store[p] : &:r207_1, r207_4
# 207| r207_6(glval<int *>) = VariableAddress[q] :
# 207| mu207_7(int *) = Store[q] : &:r207_6, r207_4
# 207| r207_6(int *) = Load[p] : &:r207_1, ~m?
# 207| r207_7(glval<int *>) = VariableAddress[q] :
# 207| mu207_8(int *) = Store[q] : &:r207_7, r207_6
# 208| r208_1(glval<int *>) = VariableAddress[p] :
# 208| r208_2(int *) = Load[p] : &:r208_1, ~m?
# 208| r208_3(int) = Constant[1] :
# 208| r208_4(int *) = PointerSub[4] : r208_2, r208_3
# 208| mu208_5(int *) = Store[p] : &:r208_1, r208_4
# 208| r208_6(glval<int *>) = VariableAddress[q] :
# 208| mu208_7(int *) = Store[q] : &:r208_6, r208_4
# 208| r208_6(int *) = Load[p] : &:r208_1, ~m?
# 208| r208_7(glval<int *>) = VariableAddress[q] :
# 208| mu208_8(int *) = Store[q] : &:r208_7, r208_6
# 209| r209_1(glval<int *>) = VariableAddress[p] :
# 209| r209_2(int *) = Load[p] : &:r209_1, ~m?
# 209| r209_3(int) = Constant[1] :
@@ -5746,6 +5752,26 @@ ir.cpp:
# 1038| v1038_9(void) = AliasedUse : ~m?
# 1038| v1038_10(void) = ExitFunction :
# 1038| void (lambda [] type at line 1038, col. 12)::(unnamed constructor)((lambda [] type at line 1038, col. 12)&&)
# 1038| Block 0
# 1038| v1038_1(void) = EnterFunction :
# 1038| mu1038_2(unknown) = AliasedDefinition :
# 1038| mu1038_3(unknown) = InitializeNonLocal :
# 1038| r1038_4(glval<unknown>) = VariableAddress[#this] :
# 1038| mu1038_5(glval<decltype([...](...){...})>) = InitializeParameter[#this] : &:r1038_4
# 1038| r1038_6(glval<decltype([...](...){...})>) = Load[#this] : &:r1038_4, ~m?
# 1038| mu1038_7(decltype([...](...){...})) = InitializeIndirection[#this] : &:r1038_6
#-----| r0_1(glval<lambda [] type at line 1038, col. 12 &&>) = VariableAddress[(unnamed parameter 0)] :
#-----| mu0_2(lambda [] type at line 1038, col. 12 &&) = InitializeParameter[(unnamed parameter 0)] : &:r0_1
#-----| r0_3(lambda [] type at line 1038, col. 12 &&) = Load[(unnamed parameter 0)] : &:r0_1, ~m?
#-----| mu0_4(unknown) = InitializeIndirection[(unnamed parameter 0)] : &:r0_3
# 1038| v1038_8(void) = NoOp :
# 1038| v1038_9(void) = ReturnIndirection[#this] : &:r1038_6, ~m?
#-----| v0_5(void) = ReturnIndirection[(unnamed parameter 0)] : &:r0_3, ~m?
# 1038| v1038_10(void) = ReturnVoid :
# 1038| v1038_11(void) = AliasedUse : ~m?
# 1038| v1038_12(void) = ExitFunction :
# 1038| void (lambda [] type at line 1038, col. 12)::operator()() const
# 1038| Block 0
# 1038| v1038_1(void) = EnterFunction :
@@ -5940,6 +5966,26 @@ ir.cpp:
# 1040| v1040_12(void) = AliasedUse : ~m?
# 1040| v1040_13(void) = ExitFunction :
# 1041| void (void Lambda(int, String const&))::(lambda [] type at line 1041, col. 23)::(unnamed constructor)((void Lambda(int, String const&))::(lambda [] type at line 1041, col. 23)&&)
# 1041| Block 0
# 1041| v1041_1(void) = EnterFunction :
# 1041| mu1041_2(unknown) = AliasedDefinition :
# 1041| mu1041_3(unknown) = InitializeNonLocal :
# 1041| r1041_4(glval<unknown>) = VariableAddress[#this] :
# 1041| mu1041_5(glval<decltype([...](...){...})>) = InitializeParameter[#this] : &:r1041_4
# 1041| r1041_6(glval<decltype([...](...){...})>) = Load[#this] : &:r1041_4, ~m?
# 1041| mu1041_7(decltype([...](...){...})) = InitializeIndirection[#this] : &:r1041_6
#-----| r0_1(glval<lambda [] type at line 1041, col. 23 &&>) = VariableAddress[(unnamed parameter 0)] :
#-----| mu0_2(lambda [] type at line 1041, col. 23 &&) = InitializeParameter[(unnamed parameter 0)] : &:r0_1
#-----| r0_3(lambda [] type at line 1041, col. 23 &&) = Load[(unnamed parameter 0)] : &:r0_1, ~m?
#-----| mu0_4(unknown) = InitializeIndirection[(unnamed parameter 0)] : &:r0_3
# 1041| v1041_8(void) = NoOp :
# 1041| v1041_9(void) = ReturnIndirection[#this] : &:r1041_6, ~m?
#-----| v0_5(void) = ReturnIndirection[(unnamed parameter 0)] : &:r0_3, ~m?
# 1041| v1041_10(void) = ReturnVoid :
# 1041| v1041_11(void) = AliasedUse : ~m?
# 1041| v1041_12(void) = ExitFunction :
# 1041| char (void Lambda(int, String const&))::(lambda [] type at line 1041, col. 23)::operator()(float) const
# 1041| Block 0
# 1041| v1041_1(void) = EnterFunction :
@@ -7697,7 +7743,6 @@ ir.cpp:
# 1376| r1376_3(String) = Call[defaultConstruct] : func:r1376_2
# 1376| mu1376_4(unknown) = ^CallSideEffect : ~m?
# 1376| mu1376_5(String) = Store[#temp1376:5] : &:r1376_1, r1376_3
# 1376| r1376_6(String) = Load[#temp1376:5] : &:r1376_1, ~m?
# 1377| v1377_1(void) = NoOp :
# 1365| v1365_4(void) = ReturnVoid :
# 1365| v1365_5(void) = AliasedUse : ~m?
@@ -7762,7 +7807,6 @@ ir.cpp:
# 1388| r1388_3(destructor_only) = Call[defaultConstruct] : func:r1388_2
# 1388| mu1388_4(unknown) = ^CallSideEffect : ~m?
# 1388| mu1388_5(destructor_only) = Store[#temp1388:5] : &:r1388_1, r1388_3
# 1388| r1388_6(destructor_only) = Load[#temp1388:5] : &:r1388_1, ~m?
# 1389| v1389_1(void) = NoOp :
# 1379| v1379_4(void) = ReturnVoid :
# 1379| v1379_5(void) = AliasedUse : ~m?
@@ -7840,7 +7884,6 @@ ir.cpp:
# 1399| r1399_3(copy_constructor) = Call[defaultConstruct] : func:r1399_2
# 1399| mu1399_4(unknown) = ^CallSideEffect : ~m?
# 1399| mu1399_5(copy_constructor) = Store[#temp1399:5] : &:r1399_1, r1399_3
# 1399| r1399_6(copy_constructor) = Load[#temp1399:5] : &:r1399_1, ~m?
# 1401| r1401_1(glval<int>) = VariableAddress[y] :
# 1401| r1401_2(glval<copy_constructor>) = VariableAddress[#temp1401:13] :
# 1401| r1401_3(glval<unknown>) = FunctionAddress[returnValue] :
@@ -9241,14 +9284,11 @@ ir.cpp:
# 1713| mu1713_2(TrivialLambdaClass) = Uninitialized[l1] : &:r1713_1
# 1714| r1714_1(glval<TrivialLambdaClass &>) = VariableAddress[l2] :
# 1714| r1714_2(glval<TrivialLambdaClass>) = VariableAddress[#temp1714:36] :
# 1714| r1714_3(glval<TrivialLambdaClass>) = VariableAddress[#temp1714:36] :
# 1714| r1714_4(TrivialLambdaClass) = Constant[0] :
# 1714| mu1714_5(TrivialLambdaClass) = Store[#temp1714:36] : &:r1714_3, r1714_4
# 1714| r1714_6(TrivialLambdaClass) = Load[#temp1714:36] : &:r1714_3, ~m?
# 1714| mu1714_7(TrivialLambdaClass) = Store[#temp1714:36] : &:r1714_2, r1714_6
# 1714| r1714_8(glval<TrivialLambdaClass>) = Convert : r1714_2
# 1714| r1714_9(TrivialLambdaClass &) = CopyValue : r1714_8
# 1714| mu1714_10(TrivialLambdaClass &) = Store[l2] : &:r1714_1, r1714_9
# 1714| r1714_3(TrivialLambdaClass) = Constant[0] :
# 1714| mu1714_4(TrivialLambdaClass) = Store[#temp1714:36] : &:r1714_2, r1714_3
# 1714| r1714_5(glval<TrivialLambdaClass>) = Convert : r1714_2
# 1714| r1714_6(TrivialLambdaClass &) = CopyValue : r1714_5
# 1714| mu1714_7(TrivialLambdaClass &) = Store[l2] : &:r1714_1, r1714_6
# 1716| r1716_1(glval<decltype([...](...){...})>) = VariableAddress[l_outer1] :
# 1716| r1716_2(glval<decltype([...](...){...})>) = VariableAddress[#temp1716:20] :
# 1716| mu1716_3(decltype([...](...){...})) = Uninitialized[#temp1716:20] : &:r1716_2
@@ -10330,7 +10370,7 @@ ir.cpp:
# 1930| r1930_1(int) = Constant[40] :
# 1930| r1930_2(glval<int>) = VariableAddress[j] :
# 1930| mu1930_3(int) = Store[j] : &:r1930_2, r1930_1
# 1930| r1930_4(int) = CopyValue : r1930_1
# 1930| r1930_4(int) = Load[j] : &:r1930_2, ~m?
# 1930| r1930_5(glval<int>) = VariableAddress[i] :
# 1930| mu1930_6(int) = Store[i] : &:r1930_5, r1930_4
# 1931| v1931_1(void) = NoOp :
@@ -10353,8 +10393,9 @@ ir.cpp:
# 1935| r1935_3(int) = Load[j] : &:r1935_2, ~m?
# 1935| r1935_4(int) = Add : r1935_3, r1935_1
# 1935| mu1935_5(int) = Store[j] : &:r1935_2, r1935_4
# 1935| r1935_6(glval<int>) = VariableAddress[i] :
# 1935| mu1935_7(int) = Store[i] : &:r1935_6, r1935_4
# 1935| r1935_6(int) = Load[j] : &:r1935_2, ~m?
# 1935| r1935_7(glval<int>) = VariableAddress[i] :
# 1935| mu1935_8(int) = Store[i] : &:r1935_7, r1935_6
# 1936| v1936_1(void) = NoOp :
# 1933| v1933_4(void) = ReturnVoid :
# 1933| v1933_5(void) = AliasedUse : ~m?
@@ -11497,6 +11538,38 @@ ir.cpp:
# 2098| v2098_7(void) = AliasedUse : ~m?
# 2098| v2098_8(void) = ExitFunction :
# 2109| char* test_strtod(char*)
# 2109| Block 0
# 2109| v2109_1(void) = EnterFunction :
# 2109| mu2109_2(unknown) = AliasedDefinition :
# 2109| mu2109_3(unknown) = InitializeNonLocal :
# 2109| r2109_4(glval<char *>) = VariableAddress[s] :
# 2109| mu2109_5(char *) = InitializeParameter[s] : &:r2109_4
# 2109| r2109_6(char *) = Load[s] : &:r2109_4, ~m?
# 2109| mu2109_7(unknown) = InitializeIndirection[s] : &:r2109_6
# 2110| r2110_1(glval<char *>) = VariableAddress[end] :
# 2110| mu2110_2(char *) = Uninitialized[end] : &:r2110_1
# 2111| r2111_1(glval<double>) = VariableAddress[d] :
# 2111| r2111_2(glval<unknown>) = FunctionAddress[strtod] :
# 2111| r2111_3(glval<char *>) = VariableAddress[s] :
# 2111| r2111_4(char *) = Load[s] : &:r2111_3, ~m?
# 2111| r2111_5(char *) = Convert : r2111_4
# 2111| r2111_6(glval<char *>) = VariableAddress[end] :
# 2111| r2111_7(char **) = CopyValue : r2111_6
# 2111| r2111_8(double) = Call[strtod] : func:r2111_2, 0:r2111_5, 1:r2111_7
# 2111| v2111_9(void) = ^BufferReadSideEffect[0] : &:r2111_5, ~m?
# 2111| mu2111_10(char *) = ^IndirectMayWriteSideEffect[1] : &:r2111_7
# 2111| mu2111_11(double) = Store[d] : &:r2111_1, r2111_8
# 2112| r2112_1(glval<char *>) = VariableAddress[#return] :
# 2112| r2112_2(glval<char *>) = VariableAddress[end] :
# 2112| r2112_3(char *) = Load[end] : &:r2112_2, ~m?
# 2112| mu2112_4(char *) = Store[#return] : &:r2112_1, r2112_3
# 2109| v2109_8(void) = ReturnIndirection[s] : &:r2109_6, ~m?
# 2109| r2109_9(glval<char *>) = VariableAddress[#return] :
# 2109| v2109_10(void) = ReturnValue : &:r2109_9, ~m?
# 2109| v2109_11(void) = AliasedUse : ~m?
# 2109| v2109_12(void) = ExitFunction :
perf-regression.cpp:
# 6| void Big::Big()
# 6| Block 0

View File

@@ -672,7 +672,7 @@ void test17() {
range(i); // $ range===50
i = 20 + (j -= 10);
range(i); // $ range="==Store: ... += ... | Store: ... = ...+10" range===60
range(i); // $ range="==Store: ... += ... | Store: ... = ...+10" range===60 range="==Store: ... -= ...+20"
}
// Tests for unsigned multiplication.

View File

@@ -56,7 +56,7 @@
while (f3_get(n)) n+=2;
for (int i = 0; i < n; i += 2) {
range(i); // $ range=>=0 SPURIOUS: range="<=Phi: call to f3_get-1" range="<=Phi: call to f3_get-2"
range(i); // $ range=>=0 range="<=Phi: call to f3_get-2"
}
}
@@ -117,3 +117,16 @@ void test_sub(int x, int y, int n) {
}
}
}
void test_div(int x) {
if (3 <= x && x <= 7) {
range(x / 2); // $ range=>=1 range=<=3
range(x / 3); // $ range=>=1 range=<=2
range(x >> 2); // $ range=>=0 range=<=1
}
if (2 <= x && x <= 8) {
range(x / 2); // $ range=>=1 range=<=4
range(x / 3); // $ range=>=0 range=<=2
range(x >> 2); // $ range=>=0 range=<=2
}
}

View File

@@ -15,6 +15,7 @@ localCallNodes
postIsNotPre
postHasUniquePre
uniquePostUpdate
| allocators.cpp:4:24:4:26 | this indirection | Node has multiple PostUpdateNodes. |
| cpp11.cpp:82:17:82:17 | this indirection | Node has multiple PostUpdateNodes. |
| cpp11.cpp:82:17:82:55 | [...](...){...} indirection | Node has multiple PostUpdateNodes. |
| ir.cpp:514:10:514:11 | definition of r2 indirection | Node has multiple PostUpdateNodes. |

View File

@@ -1,5 +1,10 @@
| file://:0:0:0:0 | Cl<char, Sa, Sb> * |
| file://:0:0:0:0 | _Complex _Float16 |
| file://:0:0:0:0 | _Complex _Float32 |
| file://:0:0:0:0 | _Complex _Float32x |
| file://:0:0:0:0 | _Complex _Float64 |
| file://:0:0:0:0 | _Complex _Float64x |
| file://:0:0:0:0 | _Complex _Float128 |
| file://:0:0:0:0 | _Complex __float128 |
| file://:0:0:0:0 | _Complex double |
| file://:0:0:0:0 | _Complex float |
@@ -16,7 +21,9 @@
| file://:0:0:0:0 | _Imaginary double |
| file://:0:0:0:0 | _Imaginary float |
| file://:0:0:0:0 | _Imaginary long double |
| file://:0:0:0:0 | __bf16 |
| file://:0:0:0:0 | __float128 |
| file://:0:0:0:0 | __fp16 |
| file://:0:0:0:0 | __int128 |
| file://:0:0:0:0 | __va_list_tag |
| file://:0:0:0:0 | __va_list_tag & |
@@ -44,6 +51,7 @@
| file://:0:0:0:0 | signed long |
| file://:0:0:0:0 | signed long long |
| file://:0:0:0:0 | signed short |
| file://:0:0:0:0 | std::float16_t |
| file://:0:0:0:0 | unknown |
| file://:0:0:0:0 | unsigned __int128 |
| file://:0:0:0:0 | unsigned char |

View File

@@ -20,6 +20,11 @@
| file://:0:0:0:0 | UnionWithDef & | 8 |
| file://:0:0:0:0 | UnionWithDef && | 8 |
| file://:0:0:0:0 | _Complex _Float16 | 4 |
| file://:0:0:0:0 | _Complex _Float32 | 8 |
| file://:0:0:0:0 | _Complex _Float32x | 16 |
| file://:0:0:0:0 | _Complex _Float64 | 16 |
| file://:0:0:0:0 | _Complex _Float64x | 32 |
| file://:0:0:0:0 | _Complex _Float128 | 32 |
| file://:0:0:0:0 | _Complex __float128 | 32 |
| file://:0:0:0:0 | _Complex double | 16 |
| file://:0:0:0:0 | _Complex float | 8 |
@@ -37,7 +42,9 @@
| file://:0:0:0:0 | _Imaginary float | 4 |
| file://:0:0:0:0 | _Imaginary long double | 16 |
| file://:0:0:0:0 | __attribute((vector_size(16))) int | 16 |
| file://:0:0:0:0 | __bf16 | 2 |
| file://:0:0:0:0 | __float128 | 16 |
| file://:0:0:0:0 | __fp16 | 2 |
| file://:0:0:0:0 | __int128 | 16 |
| file://:0:0:0:0 | __va_list_tag | 24 |
| file://:0:0:0:0 | __va_list_tag & | 8 |
@@ -83,6 +90,7 @@
| file://:0:0:0:0 | signed long | 8 |
| file://:0:0:0:0 | signed long long | 8 |
| file://:0:0:0:0 | signed short | 2 |
| file://:0:0:0:0 | std::float16_t | 2 |
| file://:0:0:0:0 | unknown | 1 |
| file://:0:0:0:0 | unsigned __int128 | 16 |
| file://:0:0:0:0 | unsigned char | 1 |

View File

@@ -2,6 +2,11 @@
| file://:0:0:0:0 | ..(*)(..) | ..(*)(..) |
| file://:0:0:0:0 | Tmpl<T> | Tmpl<T> |
| file://:0:0:0:0 | _Complex _Float16 | _Complex _Float16 |
| file://:0:0:0:0 | _Complex _Float32 | _Complex _Float32 |
| file://:0:0:0:0 | _Complex _Float32x | _Complex _Float32x |
| file://:0:0:0:0 | _Complex _Float64 | _Complex _Float64 |
| file://:0:0:0:0 | _Complex _Float64x | _Complex _Float64x |
| file://:0:0:0:0 | _Complex _Float128 | _Complex _Float128 |
| file://:0:0:0:0 | _Complex __float128 | _Complex __float128 |
| file://:0:0:0:0 | _Complex double | _Complex double |
| file://:0:0:0:0 | _Complex float | _Complex float |
@@ -18,7 +23,9 @@
| file://:0:0:0:0 | _Imaginary double | _Imaginary double |
| file://:0:0:0:0 | _Imaginary float | _Imaginary float |
| file://:0:0:0:0 | _Imaginary long double | _Imaginary long double |
| file://:0:0:0:0 | __bf16 | __bf16 |
| file://:0:0:0:0 | __float128 | __float128 |
| file://:0:0:0:0 | __fp16 | __fp16 |
| file://:0:0:0:0 | __int128 | __int128 |
| file://:0:0:0:0 | __va_list_tag & | __va_list_tag & |
| file://:0:0:0:0 | __va_list_tag && | __va_list_tag && |
@@ -45,6 +52,7 @@
| file://:0:0:0:0 | signed long | signed long |
| file://:0:0:0:0 | signed long long | signed long long |
| file://:0:0:0:0 | signed short | signed short |
| file://:0:0:0:0 | std::float16_t | std::float16_t |
| file://:0:0:0:0 | unknown | unknown |
| file://:0:0:0:0 | unsigned __int128 | unsigned __int128 |
| file://:0:0:0:0 | unsigned char | unsigned char |

View File

@@ -756,7 +756,7 @@ test.cpp:
# 92| valnum = r92_1, r92_3, r93_2
# 92| m92_4(int) = Store[x] : &:r92_3, r92_2
# 92| valnum = m92_4, m92_6, m93_4, r92_2, r92_5, r93_3
# 92| r92_5(int) = CopyValue : r92_2
# 92| r92_5(int) = Load[x] : &:r92_3, m92_4
# 92| valnum = m92_4, m92_6, m93_4, r92_2, r92_5, r93_3
# 92| m92_6(int) = Store[x] : &:r92_1, r92_5
# 92| valnum = m92_4, m92_6, m93_4, r92_2, r92_5, r93_3

View File

@@ -1,6 +1,11 @@
| ..()(..) | RoutineType | | | | |
| ..(*)(..) | FunctionPointerType | | ..()(..) | | |
| _Complex _Float16 | BinaryFloatingPointType, ComplexNumberType | | | | |
| _Complex _Float32 | BinaryFloatingPointType, ComplexNumberType | | | | |
| _Complex _Float32x | BinaryFloatingPointType, ComplexNumberType | | | | |
| _Complex _Float64 | BinaryFloatingPointType, ComplexNumberType | | | | |
| _Complex _Float64x | BinaryFloatingPointType, ComplexNumberType | | | | |
| _Complex _Float128 | BinaryFloatingPointType, ComplexNumberType | | | | |
| _Complex __float128 | BinaryFloatingPointType, ComplexNumberType | | | | |
| _Complex double | BinaryFloatingPointType, ComplexNumberType | | | | |
| _Complex float | BinaryFloatingPointType, ComplexNumberType | | | | |
@@ -17,7 +22,9 @@
| _Imaginary double | BinaryFloatingPointType, ImaginaryNumberType | | | | |
| _Imaginary float | BinaryFloatingPointType, ImaginaryNumberType | | | | |
| _Imaginary long double | BinaryFloatingPointType, ImaginaryNumberType | | | | |
| __bf16 | BinaryFloatingPointType, RealNumberType | | | | |
| __float128 | Float128Type | | | | |
| __fp16 | BinaryFloatingPointType, RealNumberType | | | | |
| __int128 | Int128Type | | | | |
| __va_list_tag | DirectAccessHolder, MetricClass, Struct, StructLikeClass | | | | |
| __va_list_tag & | LValueReferenceType | | __va_list_tag | | |
@@ -83,6 +90,7 @@
| signed long | LongType | | | | |
| signed long long | LongLongType | | | | |
| signed short | ShortType | | | | |
| std::float16_t | BinaryFloatingPointType, RealNumberType | | | | |
| unknown | UnknownType | | | | |
| unsigned __int128 | Int128Type | | | | unsigned integral |
| unsigned char | UnsignedCharType | | | | unsigned integral |

View File

@@ -97,6 +97,10 @@
| test_free.cpp:260:9:260:9 | p |
| test_free.cpp:263:12:263:12 | p |
| test_free.cpp:269:7:269:11 | ... = ... |
| test_free.cpp:277:11:277:13 | buf |
| test_free.cpp:282:10:282:12 | buf |
| test_free.cpp:288:8:288:10 | buf |
| test_free.cpp:293:8:293:10 | buf |
| virtual.cpp:18:10:18:10 | a |
| virtual.cpp:19:10:19:10 | c |
| virtual.cpp:38:10:38:10 | b |

View File

@@ -12,6 +12,10 @@ edges
| test_free.cpp:233:14:233:15 | * ... | test_free.cpp:236:9:236:10 | * ... |
| test_free.cpp:239:14:239:15 | * ... | test_free.cpp:241:9:241:10 | * ... |
| test_free.cpp:245:10:245:11 | * ... | test_free.cpp:246:9:246:10 | * ... |
| test_free.cpp:293:8:293:10 | buf | test_free.cpp:294:3:294:13 | ... = ... |
| test_free.cpp:294:3:294:13 | ... = ... | test_free.cpp:294:5:294:7 | s indirection [post update] [buf] |
| test_free.cpp:294:5:294:7 | s indirection [post update] [buf] | test_free.cpp:295:12:295:12 | s indirection [buf] |
| test_free.cpp:295:12:295:12 | s indirection [buf] | test_free.cpp:295:14:295:16 | buf |
nodes
| test_free.cpp:11:10:11:10 | a | semmle.label | a |
| test_free.cpp:12:5:12:5 | a | semmle.label | a |
@@ -38,6 +42,11 @@ nodes
| test_free.cpp:241:9:241:10 | * ... | semmle.label | * ... |
| test_free.cpp:245:10:245:11 | * ... | semmle.label | * ... |
| test_free.cpp:246:9:246:10 | * ... | semmle.label | * ... |
| test_free.cpp:293:8:293:10 | buf | semmle.label | buf |
| test_free.cpp:294:3:294:13 | ... = ... | semmle.label | ... = ... |
| test_free.cpp:294:5:294:7 | s indirection [post update] [buf] | semmle.label | s indirection [post update] [buf] |
| test_free.cpp:295:12:295:12 | s indirection [buf] | semmle.label | s indirection [buf] |
| test_free.cpp:295:14:295:16 | buf | semmle.label | buf |
subpaths
#select
| test_free.cpp:12:5:12:5 | a | test_free.cpp:11:10:11:10 | a | test_free.cpp:12:5:12:5 | a | Memory may have been previously freed by $@. | test_free.cpp:11:5:11:8 | call to free | call to free |
@@ -53,3 +62,4 @@ subpaths
| test_free.cpp:236:9:236:10 | * ... | test_free.cpp:233:14:233:15 | * ... | test_free.cpp:236:9:236:10 | * ... | Memory may have been previously freed by $@. | test_free.cpp:233:9:233:12 | call to free | call to free |
| test_free.cpp:241:9:241:10 | * ... | test_free.cpp:239:14:239:15 | * ... | test_free.cpp:241:9:241:10 | * ... | Memory may have been previously freed by $@. | test_free.cpp:239:9:239:12 | call to free | call to free |
| test_free.cpp:246:9:246:10 | * ... | test_free.cpp:245:10:245:11 | * ... | test_free.cpp:246:9:246:10 | * ... | Memory may have been previously freed by $@. | test_free.cpp:245:5:245:8 | call to free | call to free |
| test_free.cpp:295:14:295:16 | buf | test_free.cpp:293:8:293:10 | buf | test_free.cpp:295:14:295:16 | buf | Memory may have been previously freed by $@. | test_free.cpp:293:3:293:6 | call to free | call to free |

View File

@@ -267,4 +267,30 @@ void test_free_assign() {
void *a = malloc(10);
void *b;
free(b = a); // GOOD
}
struct MyStruct {
char* buf;
};
void test_free_struct(MyStruct* s) {
free(s->buf);
char c = s->buf[0]; // BAD [FALSE NEGATIVE]
}
void test_free_struct2(MyStruct s) {
free(s.buf);
char c = s.buf[0]; // BAD [FALSE NEGATIVE]
}
void test_free_struct3(MyStruct s) {
char* buf = s.buf;
free(buf);
char c = s.buf[0]; // BAD [FALSE NEGATIVE]
}
void test_free_struct4(char* buf, MyStruct s) {
free(buf);
s.buf = buf;
char c = s.buf[0]; // BAD
}

View File

@@ -67,8 +67,6 @@ edges
| argvLocal.c:115:13:115:16 | argv | argvLocal.c:136:15:136:18 | -- ... |
| argvLocal.c:115:13:115:16 | argv | argvLocal.c:136:15:136:18 | -- ... |
| argvLocal.c:115:13:115:16 | argv | argvLocal.c:136:15:136:18 | -- ... |
| argvLocal.c:115:13:115:16 | argv | argvLocal.c:136:15:136:18 | -- ... |
| argvLocal.c:115:13:115:16 | argv | argvLocal.c:136:15:136:18 | -- ... |
| argvLocal.c:115:13:115:16 | argv | argvLocal.c:136:17:136:18 | i4 |
| argvLocal.c:115:13:115:16 | argv | argvLocal.c:136:17:136:18 | i4 |
| argvLocal.c:126:10:126:13 | argv | argvLocal.c:127:9:127:10 | i5 |
@@ -163,7 +161,6 @@ nodes
| argvLocal.c:135:9:135:12 | ... ++ | semmle.label | ... ++ |
| argvLocal.c:136:15:136:18 | -- ... | semmle.label | -- ... |
| argvLocal.c:136:15:136:18 | -- ... | semmle.label | -- ... |
| argvLocal.c:136:15:136:18 | -- ... | semmle.label | -- ... |
| argvLocal.c:136:17:136:18 | i4 | semmle.label | i4 |
| argvLocal.c:139:9:139:26 | ... ? ... : ... | semmle.label | ... ? ... : ... |
| argvLocal.c:139:9:139:26 | ... ? ... : ... | semmle.label | ... ? ... : ... |

View File

@@ -186,7 +186,8 @@ internal sealed class StubVisitor : SymbolVisitor
}
break;
case TypedConstantKind.Enum:
stubWriter.Write("throw null");
stubWriter.Write($"({c.Type!.GetQualifiedName()}) ");
stubWriter.Write(c.Value!.ToString());
break;
case TypedConstantKind.Array:
stubWriter.Write("new []{");
@@ -200,7 +201,8 @@ internal sealed class StubVisitor : SymbolVisitor
}
private static readonly HashSet<string> attributeAllowList = new() {
"System.FlagsAttribute"
"System.FlagsAttribute",
"System.AttributeUsageAttribute"
};
private void StubAttribute(AttributeData a, string prefix)
@@ -219,6 +221,14 @@ internal sealed class StubVisitor : SymbolVisitor
{
stubWriter.Write("(");
WriteCommaSep(a.ConstructorArguments, StubTypedConstant);
if (a.ConstructorArguments.Any() && a.NamedArguments.Any())
stubWriter.Write(",");
WriteCommaSep(a.NamedArguments, arg =>
{
stubWriter.Write(arg.Key);
stubWriter.Write(" = ");
StubTypedConstant(arg.Value);
});
stubWriter.Write(")");
}
stubWriter.WriteLine("]");

View File

@@ -82,10 +82,16 @@ namespace Semmle.Extraction.CSharp.Entities
var paramName = Symbol.AttributeConstructor?.Parameters[i].Name;
var argSyntax = ctorArguments?.SingleOrDefault(a => a.NameColon is not null && a.NameColon.Name.Identifier.Text == paramName);
var isParamsParameter = false;
if (argSyntax is null && // couldn't find named argument
ctorArguments?.Count > childIndex && // there're more arguments
ctorArguments[childIndex].NameColon is null) // the argument is positional
{
// The current argument is not named
// so the previous ones were also not named
// so the child index matches the parameter index.
isParamsParameter = Symbol?.AttributeConstructor?.Parameters[childIndex].IsParams == true;
argSyntax = ctorArguments[childIndex];
}
@@ -94,6 +100,28 @@ namespace Semmle.Extraction.CSharp.Entities
argSyntax?.Expression,
this,
childIndex++);
if (isParamsParameter &&
ctorArguments is not null)
{
// The current argument is a params argument, so we're processing all the remaining arguments:
while (childIndex < ctorArguments.Count)
{
if (ctorArguments[childIndex].Expression is null)
{
// This shouldn't happen
continue;
}
CreateExpressionFromArgument(
constructorArgument,
ctorArguments[childIndex].Expression,
this,
childIndex);
childIndex++;
}
}
}
foreach (var namedArgument in Symbol.NamedArguments)

View File

@@ -1,3 +1,7 @@
## 1.7.2
No user-facing changes.
## 1.7.1
No user-facing changes.

View File

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

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.7.1
lastReleaseVersion: 1.7.2

View File

@@ -1,5 +1,5 @@
name: codeql/csharp-solorigate-all
version: 1.7.1
version: 1.7.2
groups:
- csharp
- solorigate

View File

@@ -1,3 +1,7 @@
## 1.7.2
No user-facing changes.
## 1.7.1
No user-facing changes.

View File

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

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.7.1
lastReleaseVersion: 1.7.2

View File

@@ -1,5 +1,5 @@
name: codeql/csharp-solorigate-queries
version: 1.7.1
version: 1.7.2
groups:
- csharp
- solorigate

View File

@@ -1,3 +1,7 @@
## 0.8.2
No user-facing changes.
## 0.8.1
### Minor Analysis Improvements

View File

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

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.8.1
lastReleaseVersion: 0.8.2

View File

@@ -1,5 +1,5 @@
name: codeql/csharp-all
version: 0.8.1
version: 0.8.2
groups: csharp
dbscheme: semmlecode.csharp.dbscheme
extractor: csharp

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