Compare commits

..

655 Commits

Author SHA1 Message Date
Tamás Vajk
17fbbdba34 Merge pull request #8233 from github/release-prep/2.8.2
Release preparation for version 2.8.2
2022-02-24 20:07:55 +01:00
Jeroen Ketema
0c788d7352 C++: Remove redundant empty line 2022-02-24 17:31:10 +01:00
Jeroen Ketema
b933a58215 C++: Replace Deprecated Queries by Deprecated Classes
This is more accurate for the only change in the list.
2022-02-24 16:48:23 +01:00
Tamas Vajk
0d16a7e38d Fix formatting of C# change logs 2022-02-24 16:06:54 +01:00
github-actions[bot]
20fe22c8c8 Release preparation for version 2.8.2 2022-02-24 14:57:08 +00:00
Tamás Vajk
83aaeca751 Merge pull request #8228 from tamasvajk/fix/change-notes-0.0.9
Fix 0.0.9 change note to match concatenated change log
2022-02-24 14:04:31 +01:00
Chris Smowton
4973224de7 Merge pull request #8216 from github/smowton/fix/creating-codeql-databases-docs-typo
Fix typo
2022-02-24 12:24:32 +00:00
Tamas Vajk
a8c2d87897 Fix 0.0.9 change note to match concatenated change log 2022-02-24 12:51:10 +01:00
Erik Krogh Kristensen
e13b2df86f Merge pull request #8185 from erik-krogh/amdImp
JS: recognize modules imported by AMD imports as library inputs
2022-02-23 20:21:45 +01:00
Chris Smowton
3167a67e65 Fix typo 2022-02-23 18:19:11 +00:00
Chris Smowton
01db73bfc7 Merge pull request #5935 from porcupineyhairs/javaSstiNew
Java : Add SSTI query
2022-02-23 17:30:02 +00:00
Mathias Vorreiter Pedersen
fd83f3a999 Merge pull request #8209 from jketema/ir-structured-bindings-tests
C++: Add IR structured binding tests
2022-02-23 16:09:40 +00:00
Chris Smowton
7b425a80bc Note path query expectations 2022-02-23 16:02:54 +00:00
Rasmus Wriedt Larsen
aeba497832 Merge pull request #7735 from yoff/python/promote-log-injection
Python: promote log injection
2022-02-23 16:21:12 +01:00
Jeroen Ketema
99dd049c1b Add IR test for tuple structured bindings 2022-02-23 16:15:19 +01:00
Jeroen Ketema
caf0f28547 Add IR test for data member structured bindings 2022-02-23 15:55:19 +01:00
Taus
3ce7d47b5b Merge pull request #7452 from jorgectf/python_jwt
Python: Add Python_JWT to JWT security query
2022-02-23 15:23:20 +01:00
Jeroen Ketema
ec2567b64b Add IR test for array structured bindings 2022-02-23 15:10:10 +01:00
Chris Smowton
a8fe10f353 Java template injection query: import pathgraph 2022-02-23 13:47:24 +00:00
CodeQL CI
7d55771092 Merge pull request #8150 from asgerf/js/prep-sharing-api-graph-mad
Approved by erik-krogh
2022-02-23 11:59:31 +00:00
CodeQL CI
62ee8fce3a Merge pull request #8186 from asgerf/js/request-forgery-docs-followup
Approved by esbena, hubwriter
2022-02-23 11:46:37 +00:00
Stephan Brandauer
a664e02d04 Merge pull request #8014 from kaeluka/js/functionality-from-untrusted-source
JS: Functionality from untrusted sources query (CWE-830)
2022-02-23 12:45:31 +01:00
Chris Smowton
50d9945625 Autoformat 2022-02-23 11:41:23 +00:00
Chris Smowton
476997a599 Replace more non-breaking spaces 2022-02-23 11:02:17 +00:00
Stephan Brandauer
1ed71e15f3 apply docreview feedback 2022-02-23 11:21:22 +01:00
Tony Torralba
f011bbc92c Merge pull request #8055 from luchua-bc/java/unsafe-url-forward-with-shared-lib
CWE-552: Switch to the shared PathSanitizer library
2022-02-23 11:00:23 +01:00
Stephan Brandauer
517d6969e1 Merge pull request #8171 from kaeluka/js/update-atm-query-docs-for-nosql-sql-injection
update ATM NosqlInjection and SqlInjection query docs
2022-02-23 10:54:37 +01:00
Asger Feldthaus
22ba43fff6 JS: Minor fixup in the client-side request forgery qhelp 2022-02-23 10:54:26 +01:00
Erik Krogh Kristensen
203212657e recognize modules imported by AMD imports as library inputs 2022-02-23 10:39:45 +01:00
Stephan Brandauer
c17d8b145a Merge pull request #8054 from asgerf/js/split-request-forgery
JS: split request forgery query into server-side and client-side variants
2022-02-23 10:27:16 +01:00
Mathias Vorreiter Pedersen
31a204a5d9 Merge pull request #8174 from jketema/hinding-cleanup
C++: Simplify `cpp/declaration-hides-variable`
2022-02-23 08:27:59 +00:00
Esben Sparre Andreasen
58e0d54744 Merge pull request #8168 from github/esbena/hapi-reflected-xss
JS: model hapi handler returns as reflected-xss sinks
2022-02-23 08:53:15 +01:00
jorgectf
4aa1c0a11e Update .expected 2022-02-23 00:55:39 +01:00
Jeroen Ketema
423d325204 C++: Simplify cpp/declaration-hides-variable
The check for `(unnamed local variable)` is no longer needed, because these
variables are now identified as being compiler generated.
2022-02-22 23:04:48 +01:00
Erik Krogh Kristensen
73f2e89f3e Merge pull request #8165 from erik-krogh/protoWrite
JS: support more property writes in js/prototype-pollution-utility
2022-02-22 21:30:22 +01:00
jorgectf
7c108c7892 Polish test 2022-02-22 20:57:20 +01:00
Jorge
0216798cb9 Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
2022-02-22 20:55:51 +01:00
Porcupiney Hairs
c81d85f321 Include suggestions from review 2022-02-22 23:07:34 +05:30
Erik Krogh Kristensen
b6b93065ff Merge pull request #8157 from erik-krogh/lodash-clone
JS: add lodash.{clone, cloneDeep} as a clone step
2022-02-22 18:12:10 +01:00
Erik Krogh Kristensen
c487bb73a7 Merge pull request #8143 from erik-krogh/pred-ql-style
QL: add ql-for-ql query for detecting bad predicate qldoc
2022-02-22 17:49:12 +01:00
Jeroen Ketema
aecc17c49b Merge pull request #7928 from jketema/structured-bindings-db-scheme
C++: Add table that identifies C++ structured bindings
2022-02-22 17:34:26 +01:00
Stephan Brandauer
6a9186cdef update ATM NosqlInjection and SqlInjection query docs 2022-02-22 16:56:18 +01:00
Geoffrey White
31d214d5ee Merge pull request #8170 from geoffw0/typos
C++: Fix Spelling Typos.
2022-02-22 15:09:50 +00:00
Mathias Vorreiter Pedersen
894992d403 Merge pull request #8169 from MathiasVP/fix-spelling-in-post-dominance-frontier
C++/C#: Fix spelling of 'postDominanceFrontier'
2022-02-22 14:54:39 +00:00
Geoffrey White
4908eaf5ec C++: Typos. 2022-02-22 14:33:11 +00:00
Mathias Vorreiter Pedersen
b6740ed4a1 C++/C#: Fix spelling of 'postDominanceFrontier'. 2022-02-22 13:48:13 +00:00
Esben Sparre Andreasen
2c527f7b35 model hapi handler returns as reflected-xss sinks 2022-02-22 14:12:01 +01:00
Erik Krogh Kristensen
517e17d422 support more property writes in js/prototype-pollution-utility, and generalize ObjectDefinePropertyAsPropWrite 2022-02-22 13:23:34 +01:00
Pierre
5ee96121fc Merge pull request #8162 from github/turbo-no-glibc-no
Docs: Add note about muslc incompatibility
2022-02-22 13:06:28 +01:00
Henry Mercer
4f7604f0dd Merge pull request #8151 from github/henrymercer/separate-atm-model-pack 2022-02-22 11:47:35 +00:00
Pierre
1d81f90260 Update docs/codeql/codeql-cli/getting-started-with-the-codeql-cli.rst
Co-authored-by: hubwriter <hubwriter@github.com>
2022-02-22 12:47:31 +01:00
Erik Krogh Kristensen
08c703f605 exclude private predicates 2022-02-22 12:34:16 +01:00
Stephan Brandauer
2278e7f6e6 CWE 830 polish error messages 2022-02-22 11:41:54 +01:00
Stephan Brandauer
82330391c3 CWE-830 add support for setting attributes via setAttribute method 2022-02-22 11:41:54 +01:00
Stephan Brandauer
d80cd1aeb5 CWE 830 test where both branches in a ternary are unsafe 2022-02-22 11:41:53 +01:00
Stephan Brandauer
2934aa1a3a rewrite docs, improve error messages, etc 2022-02-22 11:41:53 +01:00
Stephan Brandauer
d2335b65d5 stylistic improvements after review 2022-02-22 11:41:53 +01:00
Stephan Brandauer
9aec4437e2 polish qhelp for CWE-830 and add test file 2022-02-22 11:41:53 +01:00
Stephan Brandauer
44d86569ac remove illegal chars from comments 2022-02-22 11:41:53 +01:00
Stephan Brandauer
fd77e27ed9 replace taint tracking by type tracking and merge remaining queries for CWE-830 2022-02-22 11:41:53 +01:00
Stephan Brandauer
8cafa6d562 improve error message in CWE-830 2022-02-22 11:41:53 +01:00
Stephan Brandauer
780fa97869 always require integrity checking for certain CDNs 2022-02-22 11:41:53 +01:00
Stephan Brandauer
83764df4f5 rename tests for CW-830 to clarify responsibilities 2022-02-22 11:41:52 +01:00
Stephan Brandauer
8d397fea09 JS: query to find dynamic creations of DOM elements that use untrusted sources 2022-02-22 11:41:52 +01:00
Stephan Brandauer
b35c70994f permit http urls to 127.0.0.1 and others 2022-02-22 11:41:52 +01:00
Stephan Brandauer
dd2b779a3c add CWE 830 link to references 2022-02-22 11:41:52 +01:00
Stephan Brandauer
b170422c22 add changenotes for functionality from untrusted source query 2022-02-22 11:41:52 +01:00
Stephan Brandauer
6722c17bb0 JS: Functionality from untrusted sources query (CWE-830) 2022-02-22 11:41:52 +01:00
Erik Krogh Kristensen
8ff2992b56 have each case on a separate line 2022-02-22 11:40:26 +01:00
Erik Krogh Kristensen
addb27c80e deduplicate "%"
Co-authored-by: Stephan Brandauer <kaeluka@github.com>
2022-02-22 11:34:59 +01:00
Pierre
8b7f899883 Update getting-started-with-the-codeql-cli.rst 2022-02-22 11:34:49 +01:00
Pierre
6f936942fa Add note about non-glibc systems 2022-02-22 11:29:51 +01:00
Porcuiney Hairs
e536628a66 Java : Add SSTI query 2022-02-22 15:57:53 +05:30
Asger Feldthaus
1be47db2e6 JS: Factor out more JS-specific code 2022-02-22 09:51:56 +01:00
Asger Feldthaus
2d509eb345 JS: Make Impl.qll determine the location of AccessPathSyntax.qll 2022-02-22 09:51:52 +01:00
Asger Feldthaus
42a3d8c689 JS: Treat Member[x] as a language-specific token
In Ruby it is ambiguous whether Member[foo] means x.foo or x::foo
2022-02-22 09:51:52 +01:00
Asger Feldthaus
acf95d6178 JS: Move summary resolution into JS-specific code 2022-02-22 09:51:52 +01:00
Asger Feldthaus
ab1642dd3f JS: Rename {Shared,Impl} -> ApiGraphModels{,Specific} 2022-02-22 09:51:48 +01:00
Erik Krogh Kristensen
e8df6a14ca add lodash.{clone, cloneDeep} as a clone step 2022-02-21 22:27:29 +01:00
Henry Mercer
e42f759f6b Merge pull request #8153 from github/henrymercer/atm-add-cwe-tags
JS: Add CWE tags for ML-powered queries
2022-02-21 17:24:02 +00:00
Henry Mercer
5a3daa9e3f JS: Add CWE tags for ML-powered queries
- Cross-site scripting: CWE-79
- Path injection: CWE-22, CWE-23, CWE-36, CWE-73, CWE-99
- NoSQL injection: CWE-943
- SQL injection: CWE-89
2022-02-21 16:18:33 +00:00
Henry Mercer
02cce623a6 JS: Install pack dependencies in ML CI jobs 2022-02-21 16:10:15 +00:00
Henry Mercer
a89882c14e JS: Update lockfiles for ML-powered queries packs 2022-02-21 16:03:05 +00:00
Asger Feldthaus
8194c041cc JS: Merge sources to one class 2022-02-21 16:26:02 +01:00
Asger F
00ed72ed83 Apply suggestions from code review
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2022-02-21 16:24:50 +01:00
Henry Mercer
25f6ac3ec4 JS: Remove ML model pack from default workspace
We only want to put the checked out version of the model pack to test a
custom model.
Given that the repo doesn't contain any models by default, most users
won't want the local checkout of the model pack to override the one
downloaded from the package registry.
2022-02-21 15:06:30 +00:00
Henry Mercer
6fb9895367 JS: Separate the ML-powered queries model into its own pack
This allows users to more easily get started with development. Running
`codeql pack install` from the `-queries` pack will now install the ML
model.
2022-02-21 15:05:57 +00:00
Tom Bolton
0108642464 Merge pull request #8148 from github/tombolton/modify-counting-query
Update counting query to match end-to-end results
2022-02-21 15:02:43 +00:00
tombolton
e02319be9f add end to end predicate to result counting query 2022-02-21 14:35:58 +00:00
Erik Krogh Kristensen
1407b49a8f fix some instances of ql/pred-doc-style for JS 2022-02-21 15:02:21 +01:00
Erik Krogh Kristensen
11bbd872f3 add ql-for-ql query for detecting bad predicate qldoc 2022-02-21 15:02:15 +01:00
Asger F
02c4966109 Merge pull request #7878 from asgerf/dot-separated-access-paths
Shared: Switch to dot-separated access paths in summary specs
2022-02-21 13:29:09 +01:00
Alex Ford
9196b64d6e Merge pull request #8138 from github/ruby/file-write
Ruby: Implement `FileSystemWriteAccess` concept
2022-02-21 10:13:27 +00:00
Alex Ford
746290d903 Merge pull request #7713 from github/ruby/clear-text-logging
Ruby: Add `rb/clear-text-logging-sensitive-data` query
2022-02-21 10:12:33 +00:00
Jeroen Ketema
fc91c82777 Add change note 2022-02-21 10:48:46 +01:00
Jeroen Ketema
e05af1e1d1 Use underlyingElement in isStructuredBinding
Accodring to the documentation in `Element.qll`, `underlyingElement` is
supposed to be used here and not `unresolveElement`.
2022-02-21 10:46:29 +01:00
Esben Sparre Andreasen
1d437dd722 Merge pull request #8043 from github/esbena/sharpen-hardcoded-credentials
JS: Sharpen hardcoded credentials
2022-02-21 10:02:58 +01:00
Rasmus Wriedt Larsen
b59ab7f5f3 Merge branch 'main' into python/promote-log-injection 2022-02-21 09:59:31 +01:00
Erik Krogh Kristensen
5f9bd7a4a1 Merge pull request #7984 from erik-krogh/fix-ql-for-ql-js
JS: fix most ql-for-ql warnings
2022-02-21 09:15:06 +01:00
Asger Feldthaus
7848fcec80 Shared: sync AccessPathSyntax.qll 2022-02-21 08:21:53 +01:00
Asger Feldthaus
d7f07167ac Shared: Remove getLastToken again 2022-02-21 08:21:53 +01:00
Asger Feldthaus
2c2a82a070 Shared: allow spaces between arguments in a token 2022-02-21 08:21:53 +01:00
Asger Feldthaus
55ac5cb012 Shared: auto format 2022-02-21 08:21:53 +01:00
Asger Feldthaus
4985fbb526 Shared: update getSummaryCsv and related test output 2022-02-21 08:21:53 +01:00
Asger Feldthaus
dcc523a2b7 Shared: auto format 2022-02-21 08:21:53 +01:00
Asger Feldthaus
7fcbdbeada Shared: sync AccessPathSyntax.qll and FlowSummaryImpl.qll 2022-02-21 08:21:52 +01:00
Asger Feldthaus
d911e0abf8 Shared: use getToken instead of getLastToken 2022-02-21 08:21:52 +01:00
Asger Feldthaus
c4304a980d Shared: add explicit this 2022-02-21 08:21:52 +01:00
Asger Feldthaus
dc6a13242b Shared: update comment in AccessPathSyntax.qll 2022-02-21 08:21:52 +01:00
Asger Feldthaus
2907d53e17 Shared: sync AccessPathSyntax.qll and FlowSummaryImpl.qll 2022-02-21 08:21:52 +01:00
Asger Feldthaus
be63cf7049 Shared: fix qldoc and move getRawToken to top-level 2022-02-21 08:21:52 +01:00
Asger Feldthaus
c189df2341 Revert "JS: Add support for " of " syntax to help during transition"
This reverts commit 9bf522b3048c3b11f7e6d734ed797a613614a095.
2022-02-21 08:21:51 +01:00
Asger Feldthaus
57bf0b1432 Ruby: remove support for legacy syntax 2022-02-21 08:21:51 +01:00
Asger Feldthaus
e3605eed44 Ruby: update CSV rows to dot-separated syntax 2022-02-21 08:21:50 +01:00
Asger Feldthaus
7005d53a67 Ruby: manually rewrite DigSummary access path 2022-02-21 08:16:55 +01:00
Asger Feldthaus
6dbeb81f36 Ruby: use AccessPathSyntax.qll to parse input/output summary specs 2022-02-21 08:16:55 +01:00
Asger Feldthaus
0af9e8aa58 C#: remove support for legacy syntax 2022-02-21 08:16:55 +01:00
Asger Feldthaus
6bb15dcc27 C#: update CSV rows to dot-separated syntax 2022-02-21 08:16:55 +01:00
Asger Feldthaus
dffa1d1558 C#: use AccessPathSyntax.qll to parse input/output summary specs 2022-02-21 08:16:55 +01:00
Asger Feldthaus
affdbe9955 Java: remove support for legacy syntax 2022-02-21 08:16:55 +01:00
Asger Feldthaus
a121b73181 Java: update CSV rows to dot-separated syntax 2022-02-21 08:16:55 +01:00
Asger Feldthaus
7f808710ec Java: update model generator 2022-02-21 08:16:54 +01:00
Asger Feldthaus
753c557dbe Java: use AccessPathSyntax.qll to parse input/output summary specs 2022-02-21 08:16:54 +01:00
Asger Feldthaus
53935db6c6 JS: Add support for " of " syntax to help during transition 2022-02-21 08:16:54 +01:00
Asger Feldthaus
30254686d8 JS: Move ".."-parsing trick into AccessPathSyntax.qll 2022-02-21 08:16:54 +01:00
Asger Feldthaus
7c2cff3227 JS: Factor out AccessPathSyntax.qll 2022-02-21 08:16:54 +01:00
Asger Feldthaus
e2cbf47b16 JS: Fix accidental recursion 2022-02-21 08:16:53 +01:00
Harry Maclean
e4f801bea8 Merge pull request #7886 from github/hmac/split-ruby-std-library
Ruby: split standard library models into multiple files
2022-02-21 13:39:43 +13:00
Harry Maclean
9a60c7e4ac Ruby: Update filename in test fixture 2022-02-21 09:43:36 +13:00
Alex Ford
6b8537c4e0 Ruby: FileSystemWriteAccess changenote 2022-02-20 20:14:01 +00:00
Alex Ford
baabe66551 Ruby: update Files.ql tests for write accesses 2022-02-20 19:28:12 +00:00
Alex Ford
12ce3d4784 Ruby: Implement FileSystemWriteAccess for IO/File API 2022-02-20 19:27:11 +00:00
Alex Ford
4f0174e89a Ruby: add FileSystemWriteAccess concept 2022-02-20 19:26:54 +00:00
Alex Ford
dd383f942f Merge remote-tracking branch 'origin/main' into ruby/clear-text-logging 2022-02-17 15:32:31 +00:00
Alex Ford
33f4fffe16 Ruby: Simplify sub!/gsub! sanitizers for cleartext logging query 2022-02-17 13:10:44 +00:00
Jeroen Ketema
d4832b48c6 C++: Update DB scheme stats 2022-02-17 11:48:42 +01:00
Jeroen Ketema
e2bc4c88e4 C++: Expose is_structured_binding as a member of Variable 2022-02-17 11:44:08 +01:00
Jeroen Ketema
f875d722b0 C++: Add DB upgrade and downgrade scripts 2022-02-17 11:44:08 +01:00
Jeroen Ketema
f358f8f265 C++: Add DB relation identifying structured bindings 2022-02-17 11:44:08 +01:00
Asger Feldthaus
69995d5750 Shared: rephrase request forgery name and description 2022-02-17 09:07:08 +01:00
Asger Feldthaus
51442ddf47 JS: Add change note 2022-02-17 09:07:08 +01:00
Asger Feldthaus
3496ae131b JS: Factor out <recommendation> part of qhelp 2022-02-17 09:07:08 +01:00
Harry Maclean
bfd2c14555 Ruby: Add shim StandardLibrary.qll
This file re-exports everything it used to define, marking each as
deprecated to warn users that they should import `Core` or `Stdlib`
instead.
2022-02-17 20:44:04 +13:00
Harry Maclean
459f949c24 Ruby: fix old import in ActiveSupport
codeql.ruby.frameworks.StandardLibrary is deprecated
2022-02-17 20:44:04 +13:00
Harry Maclean
9fff2cfcff Ruby: Add missing documentation 2022-02-17 20:44:04 +13:00
Harry Maclean
546bfcb8ea Ruby: split tests to match stdlib changes 2022-02-17 20:44:04 +13:00
Harry Maclean
eb4f333c25 Ruby: Move UnknownMethodCall to ast/Call.qll 2022-02-17 20:44:04 +13:00
Harry Maclean
a397c65d36 Ruby: Split standard library modeling
Split the classes modeling various standard library concepts into a
structured group of multiple files.

Things that are part of the core language live in framworks/core and
standard libraries (that aren't part of core) live in frameworks/stdlib.

This mirrors the structure followed by the Ruby docs
(https://docs.ruby-lang.org/en/3.1/).

Tests are split in a followup commit.
2022-02-17 20:44:04 +13:00
Ian Lynagh
a448db11b5 Merge pull request #8052 from igfoo/igfoo/descendent
Spelling: Use "descendant" rather than "descendent" for consistency
2022-02-16 18:03:52 +00:00
Asger Feldthaus
8ac0ec8dfc JS: Write help for ClientSideRequestForgery 2022-02-16 18:33:31 +01:00
luchua-bc
f136ea0f6f Switch to the shared PathSanitizer library 2022-02-16 16:06:28 +00:00
Nick Rolfe
26e7f3273b Merge pull request #8044 from github/nickrolfe/db_upgrade_script
Language-agnostic document on db up-/downgrades
2022-02-16 15:02:04 +00:00
Nick Rolfe
6d02ea7870 doc: remove unneeded --search-path flag 2022-02-16 14:51:12 +00:00
Ian Lynagh
b16e4c0247 Spelling: Use "descendant" rather than "descendent" for consistency
$ git grep -i descendant | wc -l
170
2022-02-16 14:26:02 +00:00
Nick Rolfe
54b56c44e6 doc: avoid using Posix-specific search-path separator 2022-02-16 12:42:58 +00:00
Asger Feldthaus
91c64152d2 JS: Rephrase the qhelp for SSRF query 2022-02-16 13:35:01 +01:00
Asger Feldthaus
cf66d01e80 JS: Add consistency test 2022-02-16 13:35:01 +01:00
Asger Feldthaus
3103cfd925 JS: Rename to tests to clientSide.js and serverSide.js 2022-02-16 13:35:01 +01:00
Asger Feldthaus
3fbc3a4d70 JS: Add ClientSideRequestForgery to RequestForgery test 2022-02-16 13:35:01 +01:00
Asger Feldthaus
260638c68b JS: Add ClientSideRequestForgery and split request-forgery results between the two 2022-02-16 13:35:01 +01:00
Esben Sparre Andreasen
f08a140505 update tests for password patterns 2022-02-16 13:22:19 +01:00
Nick Rolfe
17450a5b27 Python/Ruby: rm old prepare-db-upgrade.sh files 2022-02-16 12:21:52 +00:00
Nick Rolfe
549436fc86 doc: typo 2022-02-16 12:00:35 +00:00
Nick Rolfe
26b2012024 Move Ruby doc on db upgrades to common docs dir
And explain downgrades
2022-02-16 11:35:52 +00:00
Nick Rolfe
ee5068d843 Python/Ruby: forward to generic prepare-db-upgrade.sh 2022-02-16 11:03:28 +00:00
Tony Torralba
111aabb707 Merge pull request #7712 from luchua-bc/java/file-path-injection
Java: CWE-073 File path injection with the JFinal framework
2022-02-16 12:01:34 +01:00
Jeroen Ketema
3170670f67 Merge pull request #8041 from jketema/prepare-db-upgrade-script
Add version of `prepare-db-upgrade.sh` supporting multiple languages
2022-02-16 11:45:34 +01:00
Jeroen Ketema
671528b483 Find qldir by using the location of prepare-db-upgrade.sh 2022-02-16 11:35:15 +01:00
Jeroen Ketema
8ad0d8ea69 Factor out creating upgrade.properties into a function 2022-02-16 10:54:12 +01:00
Jeroen Ketema
b27dd6ca72 Simplify check_hash_valid 2022-02-16 10:53:39 +01:00
Jeroen Ketema
f558ac5b07 Make --lang a required script argument 2022-02-16 10:18:55 +01:00
Esben Sparre Andreasen
816d79692b ignore deliberately hardcoded password strings 2022-02-16 09:47:01 +01:00
Esben Sparre Andreasen
78744a0182 add additional tests 2022-02-16 09:44:56 +01:00
Esben Sparre Andreasen
e67c09f9ab change example passwords in test 2022-02-16 08:56:00 +01:00
Arthur Baars
ebb87c4b36 Merge pull request #7975 from github/post-release-prep/codeql-cli-2.8.1
Post-release preparation for codeql-cli-2.8.1
2022-02-15 20:17:35 +01:00
Jeroen Ketema
1209bbd9b4 Add version of prepare-db-upgrade.sh supporting multiple languages 2022-02-15 18:39:21 +01:00
luchua-bc
40bf093d34 Move shared code to the lib folder and update qldoc 2022-02-15 17:28:13 +00:00
Tony Torralba
5f0ab522f3 Merge pull request #7988 from Marcono1234/marcono1234/sealed-types-predicates
Java: Add predicates for sealed classes
2022-02-15 15:11:56 +01:00
yo-h
cfcb06cad9 Merge pull request #8035 from tamasvajk/feature/hardcoded-cred-medium-prec
C#: Downgrade hardcoded credentials queries to medium precision
2022-02-15 08:09:27 -05:00
Chris Smowton
2f82a46528 Elaborate change note 2022-02-15 12:56:57 +00:00
luchua-bc
fd533f2ba8 Remove the same callable constraint 2022-02-15 12:44:23 +00:00
Mathias Vorreiter Pedersen
c48e49650a Merge pull request #8039 from jketema/downgrades
C++: Add initial DB scheme and qlpack file to downgrades directory
2022-02-15 11:30:33 +00:00
Jeroen Ketema
d59422be41 Add qlpack file to downgrades directory 2022-02-15 12:18:46 +01:00
Jeroen Ketema
0bcb5cb380 Add initial cpp DB scheme to downgrades directory 2022-02-15 11:59:46 +01:00
Mathias Vorreiter Pedersen
38e44924e7 Merge pull request #8036 from jketema/remove-legacy-relations-2
C++: Remove some unused legacy relations from the DB scheme - Take 2
2022-02-15 10:56:25 +00:00
Jeroen Ketema
3b2584a5d1 Add change note 2022-02-15 11:18:44 +01:00
Jeroen Ketema
9d7784e12d C++: Add DB downgrade script 2022-02-15 11:18:44 +01:00
Jeroen Ketema
f791c63780 C++: Add DB upgrade script 2022-02-15 11:18:44 +01:00
Jeroen Ketema
68fd953d9b C++: Mark classes depending on removed relations as deprecated
Also ensure they no longer depend on the removed relations.
2022-02-15 11:18:36 +01:00
Rasmus Wriedt Larsen
62d4bb50a5 Python: Autoformat
Trailing whitespace is a bit too easy with the ```suggestions through
the UI :|
2022-02-15 10:38:52 +01:00
Tony Torralba
bfa14fa066 Merge pull request #7823 from JLLeitschuh/improve/JLL/combined_http_headers
Java: Add HTTP Request Splitting to Netty Query
2022-02-15 10:24:36 +01:00
Rasmus Wriedt Larsen
5a90214ece Merge pull request #7783 from yoff/python/promote-ldap-injection
Python: promote LDAP injection query
2022-02-15 10:24:18 +01:00
Jeroen Ketema
bf6ca7a7be C++: Remove some unused legacy relations from the DB scheme 2022-02-15 10:16:35 +01:00
Tamas Vajk
0c667fa544 Move change note from lib to src folder 2022-02-15 09:58:12 +01:00
Tamas Vajk
c386ab5e51 Add change note 2022-02-15 09:55:18 +01:00
CodeQL CI
8f8621f82c Merge pull request #8022 from asgerf/js/url-parse-qs
Approved by esbena
2022-02-15 09:34:21 +01:00
Tamas Vajk
e8bf94faf9 C#: Downgrade hardcoded credentials queries to medium precision 2022-02-15 09:34:20 +01:00
Marcono1234
a496b1d1a1 Java: Add predicates for sealed classes 2022-02-14 21:04:38 +01:00
Chris Smowton
0bf6c83ef2 Merge pull request #4388 from JLLeitschuh/feat/JLL/java/CWE-200_temp_directory_local_information_disclosure
Java: CWE-200: Temp directory local information disclosure vulnerability
2022-02-14 18:58:44 +00:00
Chris Smowton
fd4dc95d84 Merge pull request #6443 from artem-smotrakov/ignored-hostname-verifier
Java: An experimental query for ignored hostname verification
2022-02-14 18:56:27 +00:00
yoff
de5b3a272d Merge pull request #7660 from RasmusWL/deprecate-old-modeling
Python: Deprecate old points-to based modeling
2022-02-14 19:48:03 +01:00
Chris Smowton
f2bc5849ce format 2022-02-14 17:00:14 +00:00
Nick Rolfe
9c79a171ae Merge pull request #8017 from github/nickrolfe/csharp_externalData
C#: add externalData back to dbscheme
2022-02-14 16:54:32 +00:00
Jonathan Leitschuh
2048aed0a9 Review feedback and improve temp dir vulnerable/safe code sugestion 2022-02-14 11:29:16 -05:00
Chris Smowton
a62eae5a1e Remove redundant conditions from HostnameVerificationCall.isIgnored 2022-02-14 16:26:41 +00:00
Jonathan Leitschuh
76964d58f2 Apply suggestions from code review
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2022-02-14 11:04:31 -05:00
Jonathan Leitschuh
bb580ddbab Apply suggestions from code review
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2022-02-14 11:02:05 -05:00
Jonathan Leitschuh
7dee22a130 Fix implicit 'this' usage 2022-02-14 11:00:41 -05:00
luchua-bc
2b5982fd9d Remove specified value step from additional taint step 2022-02-14 15:42:54 +00:00
yoff
3a995ec1b1 Update python/ql/lib/semmle/python/security/dataflow/LogInjectionCustomizations.qll
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2022-02-14 16:08:44 +01:00
yoff
62598c0fd1 Update python/ql/lib/semmle/python/security/dataflow/LogInjectionCustomizations.qll
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2022-02-14 16:07:40 +01:00
yoff
86786d3368 Update docs/codeql/support/reusables/frameworks.rst
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2022-02-14 16:05:59 +01:00
Asger Feldthaus
8b55a24e7c JS: Add url-parse.qs as an alias for the querystringify library 2022-02-14 15:29:50 +01:00
luchua-bc
35a924292b Model value passing between a setter and a getter call as a value step 2022-02-14 14:08:55 +00:00
Asger Feldthaus
f7108506f2 JS: Raise precision tag of js/request-forgery 2022-02-14 14:20:41 +01:00
Nick Rolfe
2633f9d02e C#: delete externalData.rel in downgrade script 2022-02-14 12:25:32 +00:00
Nick Rolfe
6e7f5f8c12 C#: add DB upgrade and downgrade scripts 2022-02-14 12:16:39 +00:00
Nick Rolfe
d43a62a09f C#: add externalData back to dbscheme
That table is still used, and is populated by the CSV extractor.
2022-02-14 12:09:00 +00:00
Rasmus Lerchedahl Petersen
d1200d0cd5 python: fix change-note formatting 2022-02-14 12:22:29 +01:00
Rasmus Lerchedahl Petersen
84447e4710 python: more detailed alert message 2022-02-14 11:55:07 +01:00
Rasmus Lerchedahl Petersen
bd14adefa0 python: add apologetic comment 2022-02-14 11:37:46 +01:00
Mathias Vorreiter Pedersen
9b8d85903c Merge pull request #8011 from MathiasVP/revert-remove-legacy-tables
Revert "Merge pull request #7982 from jketema/remove-legacy-relations"
2022-02-14 10:32:01 +00:00
Mathias Vorreiter Pedersen
bc24b03d31 Merge pull request #8012 from erik-krogh/db-in-upgrade
QL: allow raw db types in upgrade/downgrade scripts
2022-02-14 10:24:55 +00:00
Erik Krogh Kristensen
8c7bf69a87 allow raw db types in upgrade/downgrade scripts without adding a warning for it 2022-02-14 10:40:07 +01:00
Mathias Vorreiter Pedersen
ab7850c581 Revert "Merge pull request #7982 from jketema/remove-legacy-relations"
This reverts commit 2b6d57d85b, reversing
changes made to 9b4dbb9dd8.
2022-02-14 09:11:56 +00:00
Mathias Vorreiter Pedersen
2b6d57d85b Merge pull request #7982 from jketema/remove-legacy-relations 2022-02-14 07:59:19 +00:00
Artem Smotrakov
48604cd7b3 Better HostnameVerificationCall.isIgnored() 2022-02-12 15:52:16 +00:00
Artem Smotrakov
36e565d673 Use classes from semmle.code.java.security.Encryption 2022-02-12 15:31:35 +00:00
Artem Smotrakov
651e43dee6 Clarify what verifier is 2022-02-12 12:24:48 +00:00
luchua-bc
78630f25dd Match attribute name to reduce FP 2022-02-11 23:53:31 +00:00
Chuan-kai Lin
9b4dbb9dd8 Merge pull request #7895 from github/cklin/upgrades-initial-dbscheme
Upgrade scripts testing: set initial dbschemes
2022-02-11 11:06:12 -08:00
Andrew Eisenberg
0f3d780935 Merge pull request #7946 from github/aeisenberg/check-change-not
Workflows: Augment workflow to ensure failure with invalid change notes
2022-02-11 09:25:14 -08:00
Jeroen Ketema
7f4913d61f Add change notes 2022-02-11 18:15:33 +01:00
Jeroen Ketema
9d7aa176f3 C++: Mark classes depending on removed relations as deprecated
Also ensure they no longer depend on the removed relations.
2022-02-11 18:04:17 +01:00
Nick Rolfe
b3048eed21 Merge pull request #7979 from github/nickrolfe/charp
C#: fix misspellings of 'csharp'
2022-02-11 16:57:59 +00:00
Erik Krogh Kristensen
a1c5724be7 fix most ql-for-ql warnings in JS 2022-02-11 17:57:37 +01:00
Andrew Eisenberg
5092493160 Update .github/workflows/validate-change-notes.yml 2022-02-11 08:41:20 -08:00
Jeroen Ketema
5205db9e17 C++: Add DB downgrade script 2022-02-11 16:36:21 +01:00
Jeroen Ketema
3033f3f89c C++: Add DB upgrade script 2022-02-11 16:35:51 +01:00
Jeroen Ketema
94d3d63704 C++: Remove some unused legacy relations from the DB scheme 2022-02-11 16:35:08 +01:00
Erik Krogh Kristensen
360cf0ff17 Merge pull request #7981 from erik-krogh/erik-krogh/key-on-qlpacks
QL: add qlpack.yml to the cache key for QL-for-QL query build
2022-02-11 16:19:38 +01:00
Erik Krogh Kristensen
6639bdaf1e add qlpack.yml to the cache key for QL-for-QL query build 2022-02-11 16:04:39 +01:00
Nick Rolfe
dc2f653496 Merge remote-tracking branch 'origin/main' into nickrolfe/charp 2022-02-11 14:56:15 +00:00
Erik Krogh Kristensen
25f6880809 Merge pull request #7980 from erik-krogh/fix-ql-pack
QL: fix pack name for ql-for-ql
2022-02-11 15:53:02 +01:00
Erik Krogh Kristensen
1fa5265a2e fix pack name for ql-for-ql 2022-02-11 15:44:14 +01:00
Nick Rolfe
164cce7417 C#: fix misspellings of 'csharp' 2022-02-11 14:08:47 +00:00
Erik Krogh Kristensen
25d64a7901 Merge pull request #7930 from erik-krogh/rbApiIpa
RB: convert the ruby ApiGraphs to use IPA labels
2022-02-11 14:35:39 +01:00
luchua-bc
e3d0e9f083 Update normalized path node 2022-02-11 12:38:05 +00:00
Arthur Baars
678645ba57 Merge pull request #7883 from github/aibaars/ruby-cross
Ruby: add configuration for 'cross'
2022-02-11 13:15:34 +01:00
Arthur Baars
525c685584 Ruby: add configuration for 'cross' 2022-02-11 12:50:33 +01:00
Taus
d7f30de5b0 Merge pull request #7874 from RasmusWL/set-store-step
Python: Fix setStoreStep to use `SetElementContent`
2022-02-11 12:50:02 +01:00
Arthur Baars
a85b2093d6 Merge pull request #7969 from github/doc-remove-filter-queries
Docs: remove mention of 'filter queries'
2022-02-11 12:48:34 +01:00
github-actions[bot]
21bf29353f Post-release preparation for codeql-cli-2.8.1 2022-02-11 11:07:31 +00:00
Taus
327e0dad72 Merge pull request #7674 from erik-krogh/dbTypeInNonLib
QL: Use of db-type outside language core.
2022-02-11 12:00:14 +01:00
Arthur Baars
47eb96d223 Docs: remove mention of 'filter queries' 2022-02-11 11:45:34 +01:00
Erik Krogh Kristensen
5a39708cf7 move TLabel to the Impl module and cache it 2022-02-11 10:54:45 +01:00
Erik Krogh Kristensen
36e02ae9ac Merge pull request #7912 from erik-krogh/moarApi
JS: convert more type-trackers to API-graphs
2022-02-11 10:32:45 +01:00
Erik Krogh Kristensen
daa96cc218 change some docstrings based on review, and make fields private 2022-02-11 10:25:54 +01:00
Tom Hvitved
0f60401919 Merge pull request #2513 from hvitved/csharp/null-maybe-capture
C#: Remove FPs from `cs/dereferenced-value-may-be-null`
2022-02-11 10:21:15 +01:00
Erik Krogh Kristensen
6ae4652ce9 make the Impl module private again 2022-02-11 10:17:24 +01:00
Arthur Baars
74ed89409c Merge pull request #7948 from github/release-prep/2.8.1
Release preparation for version 2.8.1
2022-02-11 10:13:34 +01:00
Erik Krogh Kristensen
3791b159fb Merge pull request #7892 from erik-krogh/nanSan
JS: Add a `isNaN` sanitizer, and use it in queries that already had a typeof check
2022-02-11 10:13:06 +01:00
Erik Krogh Kristensen
2ffd79d451 Merge pull request #7921 from erik-krogh/snapdragon
JS: add model for the snapdragon library
2022-02-11 10:10:55 +01:00
Arthur Baars
58a2597c3a C++: move change note lines to correct query pack 2022-02-11 09:52:36 +01:00
Tom Hvitved
987b11c362 Merge pull request #7926 from hvitved/csharp/brotli
C#: Use Brotli instead of Gzip
2022-02-11 09:29:04 +01:00
Tamás Vajk
c5d917eb72 Improve formatting of 0.0.9 release notes 2022-02-11 09:19:43 +01:00
Esben Sparre Andreasen
a4447ce372 Update javascript/ql/lib/semmle/javascript/frameworks/Snapdragon.qll 2022-02-11 08:20:02 +01:00
luchua-bc
12c53baba4 Simplify the query 2022-02-11 01:05:06 +00:00
Harry Maclean
017183e7f3 Merge pull request #7919 from github/hmac/open-uri
Ruby: recognise additional form for OpenURI
2022-02-11 14:03:26 +13:00
Andrew Eisenberg
cba9e0b267 Fix paths in check-change-note
Library pack changes were being ignored.
2022-02-10 14:36:23 -08:00
github-actions[bot]
f25fc70b7c Release preparation for version 2.8.1 2022-02-10 22:08:24 +00:00
Andrew Eisenberg
9441ea940c Workflows: Augment workflow to ensure failure with invalid change notes 2022-02-10 13:52:54 -08:00
Erik Krogh Kristensen
f41bc64e30 add change-note 2022-02-10 22:41:35 +01:00
Arthur Baars
c9f898745c Merge pull request #7943 from github/aibaars/cpp-move-note
C++: move change note
2022-02-10 22:32:31 +01:00
Arthur Baars
6cba49abe3 C++: move change note 2022-02-10 22:13:54 +01:00
Arthur Baars
1fb3cbfeee Merge pull request #7940 from github/aibaars/js-move-note
Javascript: move change note
2022-02-10 21:20:06 +01:00
Arthur Baars
61ba896343 Javascript: move change note 2022-02-10 20:58:49 +01:00
Tom Hvitved
2b2196d638 Merge pull request #7927 from github/hvitved-patch-1
Add C# 10 and .NET 6 to `versions-compilers.rst`
2022-02-10 20:43:33 +01:00
Erik Krogh Kristensen
eb56a5aef3 support more patterns that recognize valid numbers 2022-02-10 19:50:35 +01:00
Artem Smotrakov
0ba229a64b Apply suggestions from code review (typos/formatting)
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
Co-authored-by: Chris Smowton <smowton@github.com>
2022-02-10 18:37:12 +00:00
Alex Ford
d55ba2542a Ruby: fix an alert 2022-02-10 18:35:22 +00:00
Erik Krogh Kristensen
02ed1ca392 add missing qldoc 2022-02-10 18:06:53 +01:00
yoff
a2532a86ea Merge pull request #7894 from tausbn/python-normalise-prefixes
Python: Normalise string prefixes
2022-02-10 17:57:11 +01:00
Erik Krogh Kristensen
9739929795 convert the ruby ApiGraphs to use IPA labels 2022-02-10 17:54:19 +01:00
Alex Ford
bc53570a25 Ruby: fewer mappings from dataflow nodes to ast nodes 2022-02-10 15:58:31 +00:00
Alex Ford
7c1bd9a533 Ruby: add a test case for cleartext logging that uses NonCleartextPasswordFlow 2022-02-10 15:50:56 +00:00
Alex Ford
83a3808bbe Ruby: avoid marking mutator methods as being safe (i.e. not returning sensitive data) 2022-02-10 15:50:56 +00:00
Alex Ford
b46e4ccd71 Ruby: drop SanitizerIn from ClearTextLoggingQuery 2022-02-10 15:50:56 +00:00
Alex Ford
7b4af39315 Ruby: track masked variables potentially containing sensitive data more accurately 2022-02-10 15:50:56 +00:00
Alex Ford
59ab384825 Ruby: rb/clear-text-logging-sensitive-data - match on CFG nodes rather than AST nodes 2022-02-10 15:50:56 +00:00
Jonathan Leitschuh
eee521e6ce Fix test failure for TempDirLocalInformationDisclosure 2022-02-10 10:40:40 -05:00
Tom Hvitved
a3d631f2df Add C# 10 and .NET 6 to versions-compilers.rst 2022-02-10 15:45:00 +01:00
Tom Hvitved
1c66444a61 C#: Use Brotli instead of Gzip 2022-02-10 14:30:24 +01:00
Felicity Chapman
efed21b99a Merge pull request #7885 from Marcono1234/marcono1234/extractor-doc-improvements
Fix and improve Extractor options documentation formatting
2022-02-10 12:59:45 +00:00
CodeQL CI
9ebbd9efa1 Merge pull request #7591 from asgerf/js/mysql-sinks
Approved by esbena
2022-02-10 12:50:36 +00:00
Felicity Chapman
5ec1fc11f9 Apply suggestions from code review 2022-02-10 12:41:37 +00:00
CodeQL CI
a57ee019c2 Merge pull request #7819 from asgerf/asgerf/ruby-def-nodes
Approved by hvitved
2022-02-10 12:37:34 +00:00
Taus Brock-Nannestad
be323bafaf Merge remote-tracking branch 'upstream/main' into python-normalise-prefixes 2022-02-10 12:55:49 +01:00
CodeQL CI
1a91a79b5b Merge pull request #5841 from erik-krogh/libCode
Approved by esbena, ethanpalm
2022-02-10 11:36:45 +00:00
Mathias Vorreiter Pedersen
d05dbb285c Merge pull request #7841 from jketema/structured-bindings-fix
C++: Update C++ variable hiding test
2022-02-10 11:29:38 +00:00
Erik Krogh Kristensen
d55920ad27 add model for the snapdragon library 2022-02-10 11:32:59 +01:00
Jeroen Ketema
46821fe136 Update C++ variable hiding test
Structured bindings are now handled better, so the false negative
related to structured bindings is now a true positive.
2022-02-10 10:58:32 +01:00
Erik Krogh Kristensen
12d31d750a convert more type-trackers to API-graphs 2022-02-10 09:54:52 +01:00
Stephan Brandauer
a73cdf3527 Merge pull request #7911 from kaeluka/javascript/add-getFlowLabel-to-PathNode
JS: add a getFlowLabel method to the PathNode class
2022-02-10 09:10:08 +01:00
Jonathan Leitschuh
bafcce17d4 Apply suggestions from code review
Co-authored-by: Chris Smowton <smowton@github.com>
2022-02-09 22:14:17 -05:00
Harry Maclean
d966ca8466 Ruby: recognise additional form for OpenURI 2022-02-10 15:42:15 +13:00
luchua-bc
ce03aeb4d9 Fixed an issue related to normalized path 2022-02-09 23:19:40 +00:00
Rasmus Wriedt Larsen
94f9656e8e Python: Solve deprecation warnings for old experimental queries 2022-02-10 00:09:43 +01:00
Harry Maclean
f30222256f Merge pull request #7061 from github/hmac/actiondispatch
Ruby: Rails route resolution
2022-02-10 09:46:36 +13:00
Ethan Palm
2f7f9d9032 Move explanation of example above sample code 2022-02-09 10:45:24 -08:00
Jonathan Leitschuh
ded8d64301 Remove CAPC and add CWE-93 2022-02-09 12:31:53 -05:00
Jonathan Leitschuh
03fdee3767 Cleanup Netty Response Splitting Query 2022-02-09 12:28:11 -05:00
Jonathan Leitschuh
8ffe878722 Apply suggestions from code review
Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com>
2022-02-09 12:28:11 -05:00
Jonathan Leitschuh
c732cb7759 Add HTTP Request Splitting to Netty Query 2022-02-09 12:28:10 -05:00
Stephan Brandauer
3e88d46e0f add a getFlowLabel method to the PathNode class 2022-02-09 17:28:25 +01:00
Jonathan Leitschuh
49a73673b6 Fix FP from mkdirs call on exact temp directory 2022-02-09 11:04:23 -05:00
Tamás Vajk
6483a92587 Merge pull request #7865 from github/post-release-prep/codeql-cli-2.8.0
Post-release preparation for codeql-cli-2.8.0
2022-02-09 16:42:38 +01:00
Jonathan Leitschuh
787e3dac31 Update java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure.ql
Co-authored-by: Chris Smowton <smowton@github.com>
2022-02-09 10:07:56 -05:00
Tom Hvitved
c695388c29 Merge pull request #7891 from hvitved/ruby/dataflow/hide-ssa-nodes
Ruby: Hide more SSA nodes from data-flow path explanations
2022-02-09 15:56:15 +01:00
Tom Hvitved
0bd8411cb6 Ruby: Hide more SSA nodes from data-flow path explanations 2022-02-09 15:31:10 +01:00
Mathias Vorreiter Pedersen
336c25d929 Merge pull request #7913 from RasmusWL/ql-qlpacks
QL: Streamline qlpacks
2022-02-09 13:37:19 +00:00
Rasmus Wriedt Larsen
1f50624cf4 QL: Streamline qlpacks
So they follow the same format as the other languages.

`git grep codeql-ql` in the ql/ subfolder does not yield any results
now.
2022-02-09 14:08:36 +01:00
Rasmus Wriedt Larsen
9d5e8d5bd8 Merge pull request #7842 from RasmusWL/consistency-queires
Misc: Streamline `consistency-queries/qlpack.yml`
2022-02-09 13:42:18 +01:00
Nick Rolfe
1eba8277ee Merge pull request #7614 from github/nickrolfe/array_flow_summaries
Ruby: add more Array/Enumerable flow summaries
2022-02-09 09:57:59 +00:00
Harry Maclean
f276904fa9 Ruby: Add nomagic pragma to helper 2022-02-09 22:38:35 +13:00
Michael Nebel
ff369f2a36 Merge pull request #7846 from michaelnebel/csharp/deconstruction
C# 10: Tuple deconstruction.
2022-02-09 10:08:16 +01:00
Mathias Vorreiter Pedersen
bbbb5268ce Merge pull request #7881 from geoffw0/clrtxtperf
CPP: Fix performance for cpp/cleartext-transmission
2022-02-09 09:03:44 +00:00
Erik Krogh Kristensen
5340530cb7 use the number guard in existing queries that contained typeof checks 2022-02-09 09:51:57 +01:00
Erik Krogh Kristensen
d6721ec574 implement a isNaN guard for unsafe-shell-command-construction 2022-02-09 09:51:57 +01:00
Tom Hvitved
9440a45015 Merge branch 'main' into post-release-prep/codeql-cli-2.8.0 2022-02-09 09:40:33 +01:00
yoff
f21ac04285 Update python/ql/lib/semmle/python/frameworks/Stdlib.qll
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2022-02-09 09:22:31 +01:00
luchua-bc
4609227e76 Use data model for request/session attribute operations 2022-02-09 03:24:46 +00:00
jorgectf
3ccac4ed8a Update .expected 2022-02-08 23:59:36 +01:00
Jonathan Leitschuh
7f46640176 Consider calls to setReadable(false, false) then setReadable(true, true) to be safe 2022-02-08 17:57:10 -05:00
jorgectf
c6d8b97871 Make verifyCall() a private predicate 2022-02-08 23:37:17 +01:00
jorgectf
7b51b91d13 Improve test 2022-02-08 23:33:43 +01:00
jorgectf
ed60d16367 Refactor the way to check the verifying call 2022-02-08 23:33:30 +01:00
Jorge
f1fab98ea2 Merge branch 'github:main' into python_jwt 2022-02-08 23:12:58 +01:00
Taus Brock-Nannestad
54ae744b2c Python: Also update Python 2 file 2022-02-08 22:08:53 +01:00
Harry Maclean
3206384884 Merge pull request #7824 from github/hmac/constantize 2022-02-09 08:30:21 +13:00
Chuan-kai Lin
a7f1ee574c Upgrade scripts testing: set initial dbschemes
This commit sets initial dbschemes for cpp, csharp, java, javascript, and
python so that automated testing for upgrade scripts would also cover legacy
upgrades.
2022-02-08 11:11:41 -08:00
Tom Hvitved
b2419d60bd Merge pull request #7090 from hvitved/ruby/perf
Ruby: Cache more predicates
2022-02-08 20:02:33 +01:00
Chris Smowton
143d64c92c Merge pull request #7879 from github/smowton/admin/getting-started-mention-codeql-go-deps
Docs: Note codeql-go needs an install step before use
2022-02-08 18:07:26 +00:00
Alex Ford
81ed5d0ff7 Ruby: comment and node description fixes
Co-authored-by: Harry Maclean <hmac@github.com>
2022-02-08 18:03:29 +00:00
Taus Brock-Nannestad
6ea8986daa Python: Normalise string prefixes 2022-02-08 16:48:17 +01:00
Erik Krogh Kristensen
4bbb7ad320 Merge pull request #7876 from erik-krogh/zipRelative
JS: recognize more startswith sanitizers for path-injection queries
2022-02-08 15:22:39 +01:00
Nick Rolfe
ade7921079 Merge pull request #7890 from github/nickrolfe/unique_node
Ruby/QL: add `unique` annotation on `node` column
2022-02-08 13:15:17 +00:00
Tom Hvitved
984e01ecf0 C#: Remove FPs from cs/dereferenced-value-may-be-null
Apply a conservative approach by filtering out results for accesses to
captured nullable values, when there is an (implicit) call to the capturing
callable which is `null`-guarded. For example:

```
bool M(int? i, IEnumerable<int> @is)
{
    if (i.HasValue)
        return @is.Any(j => j == i.Value); // GOOD
    return false;
}
```
2022-02-08 14:01:57 +01:00
Tom Hvitved
7948d965a0 C#: Add nullness tests for captured variables 2022-02-08 13:52:29 +01:00
Tom Hvitved
3b5267eca5 Ruby: Cache DataFlow::Node::{toString,getLocation} 2022-02-08 13:03:42 +01:00
Tom Hvitved
f337459a4a Ruby: Cache capturedEntryWrite 2022-02-08 13:03:42 +01:00
Tom Hvitved
b041bc03d1 Ruby: Cache ConditionBlock::(immediately)Controls 2022-02-08 13:03:41 +01:00
Tom Hvitved
4037d1ff96 Ruby: Cache ErbDirective::getAChildStmt 2022-02-08 13:03:41 +01:00
Tom Hvitved
4c5f32ba4a Ruby: Cache exprNodeReturnedFrom 2022-02-08 13:03:31 +01:00
Tom Hvitved
45412fa17f Cache hasLocalSource 2022-02-08 13:03:27 +01:00
Chris Smowton
a6596ea7ce Fix test requirements, formatting 2022-02-08 12:01:32 +00:00
Erik Krogh Kristensen
28ba78cb76 add explicit this 2022-02-08 12:20:21 +01:00
Michael Nebel
c04e344192 Merge pull request #7749 from michaelnebel/csharp/lambda-improvements
C# 10 - Lambda improvements.
2022-02-08 11:28:55 +01:00
Benjamin Muskalla
b62df5a9ad Merge pull request #7872 from bmuskalla/fixCoverageCollection
Collect framework coverage on demand
2022-02-08 11:27:48 +01:00
Henry Mercer
eff0ca01b1 Merge pull request #7417 from github/henrymercer/java/update-telemetry-query-metadata
Java: Start running telemetry queries on Code Scanning
2022-02-08 10:26:30 +00:00
Chris Smowton
79654592d9 Apply suggestions from code review 2022-02-08 10:23:46 +00:00
Benjamin Muskalla
ff8a96b96d Rename framework coverage query
Move it to the other summary queries, update all references.
2022-02-08 11:14:03 +01:00
Rasmus Wriedt Larsen
a8edd44a3c Python: Update .expected 2022-02-08 11:12:34 +01:00
Benjamin Muskalla
85a8efab63 Update .github/workflows/csv-coverage-metrics.yml
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2022-02-08 11:07:56 +01:00
Benjamin Muskalla
6e3d2a2046 Update misc/suite-helpers/security-and-quality-selectors.yml
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2022-02-08 11:07:35 +01:00
Benjamin Muskalla
fb91821882 Update misc/suite-helpers/security-extended-selectors.yml
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2022-02-08 11:06:51 +01:00
Benjamin Muskalla
94c517efd6 Update misc/suite-helpers/code-scanning-selectors.yml
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2022-02-08 11:06:35 +01:00
Benjamin Muskalla
284c397883 Update misc/suite-helpers/lgtm-selectors.yml
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2022-02-08 11:06:30 +01:00
Benjamin Muskalla
e7823a78ef Update .github/workflows/csv-coverage-metrics.yml
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2022-02-08 11:06:21 +01:00
Nick Rolfe
fa16ff9ffc QL for QL: make node column unique 2022-02-08 09:59:11 +00:00
Nick Rolfe
8881031d0a Ruby: add upgrade/downgrade scripts 2022-02-08 09:57:55 +00:00
Nick Rolfe
2037368f62 Ruby: make node column unique 2022-02-08 09:55:34 +00:00
Nick Rolfe
dbe2951aec Merge pull request #7880 from github/nickrolfe/locations_column_ql
QL for QL: sync changes from Ruby
2022-02-08 09:53:06 +00:00
CodeQL CI
db8ffb5ba9 Merge pull request #7870 from erik-krogh/nodeReExport
Approved by esbena
2022-02-08 09:44:25 +00:00
Erik Krogh Kristensen
d73b2effa0 rename maybeGetJoinArg maybeGetPathSuffix 2022-02-08 10:42:06 +01:00
Asger Feldthaus
862c3b9752 Ruby: autoformat 2022-02-08 10:22:15 +01:00
Asger Feldthaus
2b36703bfb Ruby: add def= tags to API graph test 2022-02-08 10:20:25 +01:00
Geoffrey White
6005f3d2d4 C++: Add pragma[noinline]. 2022-02-08 09:13:51 +00:00
Asger Feldthaus
66b1c86402 Ruby: update qldoc for def predicate 2022-02-08 10:00:14 +01:00
Asger Feldthaus
9ac526be89 Ruby: change binding for getParameter/getKeywordParameter 2022-02-08 09:36:05 +01:00
Asger Feldthaus
073493bb2e Ruby: fix qldoc for getMethod 2022-02-08 09:28:07 +01:00
luchua-bc
ff4826d203 Correct the data model and update qldoc 2022-02-08 04:02:27 +00:00
Erik Krogh Kristensen
cc3f9bf2a8 fix performance issue by inlining a simpler version of getASourceProp 2022-02-08 00:22:01 +01:00
Erik Krogh Kristensen
aa95dd4ec7 fix typo
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
2022-02-08 00:19:40 +01:00
Harry Maclean
3031b39dc1 Ruby: prevent bad join in ActionController.qll 2022-02-08 12:10:23 +13:00
Marcono1234
d0547cdbfd Fix and improve Extractor options documentation formatting 2022-02-07 21:05:14 +01:00
Jonathan Leitschuh
c4112e6d4c Post refactor fixiup 2022-02-07 15:02:13 -05:00
Chris Smowton
de38638db6 Combine CWE-200 queries 2022-02-07 14:22:36 -05:00
Rasmus Wriedt Larsen
eb109828c0 Merge pull request #7252 from museljh/feature/cwe-338
Python: CWE-338 insecureRandomness
2022-02-07 19:30:06 +01:00
Nick Rolfe
073d325750 QL for QL: update dbscheme stats 2022-02-07 17:54:35 +00:00
Nick Rolfe
3ee109731a QL for QL: sync changes from Ruby
In particular, update the dbscheme to put location columns in a single
table.
2022-02-07 17:44:40 +00:00
Nick Rolfe
9217d0e1b9 Merge pull request #7875 from github/nickrolfe/locations_column
Ruby: put AST node locations in a single table
2022-02-07 17:43:33 +00:00
Geoffrey White
6727069893 C++: Autoformat. 2022-02-07 17:33:11 +00:00
Geoffrey White
d1b6871314 C++: Restrict type. 2022-02-07 17:32:52 +00:00
Geoffrey White
005dfdffdb C++: Speed up cpp/cleartext-transmission ('Encrypted' class). 2022-02-07 17:19:25 +00:00
Chris Smowton
27b9e1c01b Docs: Note codeql-go needs an install step before use 2022-02-07 16:11:42 +00:00
Erik Krogh Kristensen
b59c7911a3 update locations of expected output 2022-02-07 15:23:26 +01:00
Erik Krogh Kristensen
ca5f91e587 recognize more startswith sanitizers for path-injection queries 2022-02-07 14:19:13 +01:00
Michael Nebel
f21e084628 C#: Fix issue in naming of class in test file. 2022-02-07 14:15:59 +01:00
Michael Nebel
f5fc15e74d C#: Add some testcases to cover mixed assignment and declarations in tuples. 2022-02-07 14:11:31 +01:00
Michael Nebel
0cf4b3fbcc C#: Added dataflow testcases for tuple mixed initialization and assignment. 2022-02-07 14:11:31 +01:00
Michael Nebel
bcf732a7cb C#: Re-factor tuple tests to use the default value flow configuration. 2022-02-07 14:11:31 +01:00
Michael Nebel
f478bf5b9b Merge pull request #7809 from michaelnebel/csharp/test-pattern-match-flow
C#: Add flow test cases for undetected value flow, when making variable bindings in pattern matching.
2022-02-07 14:05:50 +01:00
Nick Rolfe
881776a2ac Ruby: delete commented-out code 2022-02-07 12:50:06 +00:00
Nick Rolfe
e049f08c24 Ruby: update dbscheme stats 2022-02-07 12:42:34 +00:00
Erik Krogh Kristensen
6f28cb9201 lower the precision of js/unsafe-code-construction 2022-02-07 13:35:29 +01:00
Erik Krogh Kristensen
06f9924194 add change note 2022-02-07 13:34:18 +01:00
Erik Krogh Kristensen
896d2bad0e update expected output now that JSON.stringify() is seen as a sanitizer 2022-02-07 13:34:18 +01:00
Erik Krogh Kristensen
d1d4ebb3b5 add values written to the global scope as exports 2022-02-07 13:34:18 +01:00
Erik Krogh Kristensen
91b03f56ad move .qll files from src to lib 2022-02-07 13:34:18 +01:00
Erik Krogh Kristensen
eb133f59f6 update qhelp to focus on properly documenting potentially unsafe library functions 2022-02-07 13:34:18 +01:00
Erik Krogh Kristensen
a9f7756788 reuse utility predicate 2022-02-07 13:34:18 +01:00
Erik Krogh Kristensen
681179dcbb add comment about parameters named "code" 2022-02-07 13:34:18 +01:00
Erik Krogh Kristensen
53315e6ab6 ignore sources named "code" 2022-02-07 13:34:18 +01:00
Erik Krogh Kristensen
59cc099008 add missing qldoc 2022-02-07 13:34:18 +01:00
Erik Krogh Kristensen
d77c28f6a7 add qhelp for unsafe-code-construction 2022-02-07 13:34:18 +01:00
Erik Krogh Kristensen
d790f3ccbb add test for unsafe-code-construction query 2022-02-07 13:34:18 +01:00
Erik Krogh Kristensen
198a464346 add js/unsafe-code-construction query 2022-02-07 13:34:18 +01:00
Erik Krogh Kristensen
955ad8c458 add JSON.stringify as a code-injection sanitizer 2022-02-07 13:34:18 +01:00
Erik Krogh Kristensen
68a5c1f5b5 add code-injection sink for calls to node 2022-02-07 13:34:18 +01:00
Rasmus Wriedt Larsen
62702d0ca9 Python: Fix setStoreStep to use SetElementContent 2022-02-07 13:18:36 +01:00
Nick Rolfe
b3b2bba618 Ruby: make some generated predicates final 2022-02-07 12:17:50 +00:00
Nick Rolfe
b43cc23277 Ruby: add db downgrade script 2022-02-07 12:10:36 +00:00
Nick Rolfe
e8855c3718 Ruby: add db upgrade script 2022-02-07 12:10:36 +00:00
Nick Rolfe
388d361ec3 Ruby: put AST node locations in a single table 2022-02-07 12:10:36 +00:00
Michael Nebel
99f89f1fe2 C#: Update db stats file. 2022-02-07 12:57:10 +01:00
Mathias Vorreiter Pedersen
55e69d421c Merge pull request #7849 from Yonah125/main
C/C++: Useless Test : verification of "Fully converted" Type
2022-02-07 11:46:51 +00:00
Benjamin Muskalla
2f94356899 Run daily 2022-02-07 12:12:29 +01:00
Benjamin Muskalla
bd417769ce Add workflow to upload metrics 2022-02-07 12:08:18 +01:00
Benjamin Muskalla
a1432c47dc Exclude framework coverage query from suites
We don't want to run this query on any database but rather
in a specific setup. Exclude from suites by default.
2022-02-07 12:08:18 +01:00
Benjamin Muskalla
9af50f5216 Turn framework coverage into metric query 2022-02-07 12:08:18 +01:00
Jeroen Ketema
1f2865c7cc Merge pull request #7798 from jketema/missing-open-arg
C++: Add query for missing mode argument in `open`/`openat` calls
2022-02-07 12:01:44 +01:00
BACK Yonah
61dc9ef12e C/C++: AutoFormat fix 2022-02-07 11:41:17 +01:00
Rasmus Wriedt Larsen
32cd7d6fa7 Add groups to all consistency-queries/qlpack.yml
as discussed in PR review
2022-02-07 11:15:48 +01:00
Tom Hvitved
dc09e87cb2 Ruby: Use SimpleSummarizedCallable in a few more places 2022-02-07 11:05:32 +01:00
Erik Krogh Kristensen
0584a6acaf recognize a nodejs re-exports in a loop 2022-02-07 10:12:38 +01:00
Michael Nebel
b2e18ebae1 C#: Lambda improvements change note. 2022-02-07 09:22:46 +01:00
Michael Nebel
782d6da754 C#: Support for lambda expression explicit return types and lambda attributes. 2022-02-07 09:19:47 +01:00
github-actions[bot]
b4ab86c020 Post-release preparation for codeql-cli-2.8.0 2022-02-06 23:34:07 +00:00
Arthur Baars
ac03fab986 Merge pull request #7753 from aibaars/ruby-3.1
Ruby 3.1 features
2022-02-06 21:06:16 +01:00
Artem Smotrakov
f53b2fcc62 Updated IgnoredHostnameVerification.ql to cover more uses of HostnameVerifier.verify() 2022-02-06 11:23:20 +00:00
Jonathan Leitschuh
1f47ea5164 Update to new change note format 2022-02-04 17:16:12 -05:00
Jonathan Leitschuh
0268dd9f0a Add file creation sanitizer 2022-02-04 17:10:27 -05:00
Jonathan Leitschuh
9299c7996d Add information disclosure test fix suggestions 2022-02-04 17:10:27 -05:00
Jonathan Leitschuh
0a621c2801 Fix the formatting in TempDirLocalInformationDisclosureFromMethodCall 2022-02-04 17:10:27 -05:00
Jonathan Leitschuh
79db76dcf8 Fix test failures TempDirLocalInformationDisclosureFromSystemProperty 2022-02-04 17:10:27 -05:00
Jonathan Leitschuh
d5c9af31b2 Fixup documentation/code from PR feedback 2022-02-04 17:10:26 -05:00
Jonathan Leitschuh
f7a4aac525 Apply suggestions from code review
Co-authored-by: Chris Smowton <smowton@github.com>
2022-02-04 17:10:26 -05:00
Jonathan Leitschuh
a4b5573f53 Apply suggestions from code review
Co-authored-by: Chris Smowton <smowton@github.com>
2022-02-04 17:10:26 -05:00
Jonathan Leitschuh
a8d25b63ac Apply suggestions from code review
Co-authored-by: Chris Smowton <smowton@github.com>
2022-02-04 17:10:26 -05:00
Chris Smowton
e795823d97 Autoformat TempDirUtils.qll 2022-02-04 17:10:26 -05:00
Jonathan Leitschuh
7e514e9ef9 Add QLdoc and fix Compiler Errors in Tests 2022-02-04 17:10:26 -05:00
Jonathan Leitschuh
cb30385684 Update java/ql/src/Security/CWE/CWE-200/TempDirUtils.qll
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2022-02-04 17:10:26 -05:00
Jonathan Leitschuh
df716cbaa0 Revert changes to MethodAccessSystemGetProperty 2022-02-04 17:10:25 -05:00
Jonathan Leitschuh
66831989b7 Add QLdoc to TempDirUtils 2022-02-04 17:10:25 -05:00
Jonathan Leitschuh
7e55c92eb4 Apply suggestions from code review
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2022-02-04 17:10:25 -05:00
Jonathan Leitschuh
c19f52cd04 Add release notes for "Temporary Directory Local information disclosure" 2022-02-04 17:10:25 -05:00
Jonathan Leitschuh
f6067d28f9 Fix file names and formatting from PR feedback 2022-02-04 17:10:25 -05:00
Jonathan Leitschuh
41b5011b81 Apply suggestions from code review
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2022-02-04 17:10:25 -05:00
Jonathan Leitschuh
7929faedc0 Apply suggestions from code review
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2022-02-04 17:10:25 -05:00
Jonathan Leitschuh
f910fd4719 Remove path flow tracking in 'TempDirLocalInformationDisclosureFromMethodCall' 2022-02-04 17:10:25 -05:00
Jonathan Leitschuh
e4c017e888 Apply suggestions from code review
Co-authored-by: Arthur Baars <aibaars@github.com>
2022-02-04 17:10:24 -05:00
Jonathan Leitschuh
13fed0e9b6 Temp Dir Info Disclosure: Final pass and add documentation 2022-02-04 17:10:24 -05:00
Jonathan Leitschuh
bc12e994b0 Add java.nio.file.Files API checks 2022-02-04 17:10:24 -05:00
Jonathan Leitschuh
ecad7534ae Add mkdirs check 2022-02-04 17:10:24 -05:00
Jonathan Leitschuh
cf0ed81575 Add TempDir taint tracking for Files.write 2022-02-04 17:10:24 -05:00
Jonathan Leitschuh
3a15678b1e Java: CWE-200: Temp directory local information disclosure vulnerability 2022-02-04 17:10:23 -05:00
Erik Krogh Kristensen
ab2d3a7ca0 Merge pull request #7828 from Naman-ntc/main
JS: Adding model for `.get` function of `Map` in Unvalidated Dynamic Method Call
2022-02-04 20:19:02 +01:00
Erik Krogh Kristensen
f00d723c49 Merge pull request #7843 from erik-krogh/CVE-2021-23484
JS: add file sources from `jszip` to `js/zip-slip`
2022-02-04 20:17:43 +01:00
BACK Yonah
21fdc53d62 C/C++: Using UnspecifiedType instead of Type 2022-02-04 19:12:15 +01:00
Nick Rolfe
9744cf2457 Ruby: apply suggested simplification from review 2022-02-04 17:14:47 +00:00
Nick Rolfe
aaff3226c9 Ruby: prefer ...isInt(x) over x = ...getInt() 2022-02-04 17:10:22 +00:00
BACK Yonah
b2ca25abef Merge branch 'main' of https://github.com/github/codeql 2022-02-04 18:09:19 +01:00
BACK Yonah
f4a1d1d5e6 C/C++: Useless Test Fully converted verification 2022-02-04 18:05:03 +01:00
Nick Rolfe
45962f1cad Ruby: make this unique for each method
Even when summaries are shared in a single class.
2022-02-04 17:03:55 +00:00
BACK Yonah
34320cb57b C/C++: Useless Test Fully converted verification 2022-02-04 18:03:29 +01:00
Ian Wright
6c3daf49f9 Merge pull request #7785 from github/z80coder/impose-length-restriction
Restrict AST nodes according to string length
2022-02-04 16:35:04 +00:00
Nick Rolfe
7a9ddc28bf Ruby: address some more feedback on array flow summaries 2022-02-04 16:33:27 +00:00
Henry Mercer
bb1e89d261 Merge pull request #7848 from github/henrymercer/js-ml-powered-codeowners
JS: Add codeowners for ML-powered queries
2022-02-04 16:08:56 +00:00
Michael Nebel
6ee30843bb C#: Add lambda attributes test cases. 2022-02-04 16:54:49 +01:00
Henry Mercer
22ef35e13a JS: Add codeowners for ML-powered queries
Create a new reviewers team @github/codeql-ml-powered-queries-reviewers
for reviewing ML-powered queries and the associated CodeQL libraries.
2022-02-04 15:49:44 +00:00
Ian Wright
be5e8dae05 Update javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/FunctionBodyFeatures.qll
Co-authored-by: Henry Mercer <henrymercer@github.com>
2022-02-04 15:41:50 +00:00
Michael Nebel
7b3ba3cb96 C#: Modify database schema to allow lambda expression to be attributable and extract the lambda expression attributes. 2022-02-04 16:34:58 +01:00
Michael Nebel
f412d49ba4 C#: Add some examples lambdas with different kind of attributes and update existing testcases. 2022-02-04 16:34:58 +01:00
Michael Nebel
bb3f9cea3a C#: Update test cases(s) expected output. 2022-02-04 16:34:58 +01:00
Michael Nebel
7520948ec4 C#: Add test case for finding lambdas with explicit return types. 2022-02-04 16:34:58 +01:00
Michael Nebel
83a5ef4961 C#: Examples of lambda expressions with explicit return types. 2022-02-04 16:34:58 +01:00
Michael Nebel
25019dbaa0 C#: Add support QL library support for lambda explicit return types. 2022-02-04 16:34:58 +01:00
Michael Nebel
eb8c226749 C#: Add support for explicit return types in the extractor. 2022-02-04 16:34:58 +01:00
Michael Nebel
ae62704d3a C#: Add table for explicit return type in lambda expressions. 2022-02-04 16:34:57 +01:00
Michael Nebel
ccb727e3ca C#: Test cases that shows that lambdas can be naturally (implicitly) typed and that the type is indistinguishable from the equivalent explicitly typed declaration. 2022-02-04 16:34:57 +01:00
Michael Nebel
a67033034a C#: Example of naturally typed lambda. 2022-02-04 16:34:57 +01:00
Ian Wright
e57a0e0e2f Update javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/FunctionBodyFeatures.qll
Co-authored-by: Henry Mercer <henrymercer@github.com>
2022-02-04 15:21:56 +00:00
Ian Wright
b38335a6c2 add QL comment; inline a predicate; restore a comment 2022-02-04 15:21:09 +00:00
Nick Rolfe
ed00f2b0d2 Ruby: address some feedback on array flow summaries 2022-02-04 13:40:39 +00:00
Erik Krogh Kristensen
edcb3ba902 add file sources from jszip to js/zip-slip 2022-02-04 14:39:49 +01:00
Tom Hvitved
693aa69abd Update csharp/ql/consistency-queries/qlpack.yml 2022-02-04 14:38:25 +01:00
Naman Jain
009c95774e update expected files 2022-02-04 12:28:17 +00:00
Nick Rolfe
161d766ba9 Ruby: address review comments on array_flow.rb 2022-02-04 11:59:59 +00:00
Michael Nebel
ade119f4a8 C#: Add flow test cases for undetected value flow, when making variable bindinds in pattern matching. 2022-02-04 12:57:58 +01:00
Jeroen Ketema
b967eaf25d Add documentation for parseHex 2022-02-04 12:35:13 +01:00
Rasmus Wriedt Larsen
c817ba5718 Python: Add consistency-queries/qlpack.yml
But no queries yet
2022-02-04 12:08:54 +01:00
Rasmus Wriedt Larsen
0bcfc4b657 Ruby: Update consistency-queries/qlpack.yml
I'm not sure whether this means the consistency queries were run using
the 0.0.1 release of the `codeql/ruby-all` qlpack, but using `"*"` at
least ensures that it is always using the version from the CodeQL repo.
2022-02-04 12:06:50 +01:00
Rasmus Wriedt Larsen
580d7d9df0 QL: Update consistency-queries/qlpack.yml 2022-02-04 12:06:50 +01:00
Rasmus Wriedt Larsen
1db4bdc607 C#: Update consistency-queries/qlpack.yml 2022-02-04 12:06:50 +01:00
Rasmus Wriedt Larsen
2220d3cc47 Misc: Allow */ql/consistency-queries/qlpack.yml 2022-02-04 12:06:50 +01:00
Rasmus Wriedt Larsen
2e788ea86e Python: Accept deprecation warnings for old tests 2022-02-04 12:02:09 +01:00
Rasmus Wriedt Larsen
438a01e911 Python: Deprecate old bottle points-to extension 2022-02-04 12:02:09 +01:00
Rasmus Wriedt Larsen
c9e36aaf72 Python: Fix deprecated deprecated 2022-02-04 12:02:09 +01:00
Rasmus Wriedt Larsen
9ec531f040 Python: Add deprecation change-note 2022-02-04 12:02:09 +01:00
Rasmus Wriedt Larsen
84fdd8a739 Python: Add non-deprecated httpVerb to Concepts 2022-02-04 12:02:09 +01:00
Rasmus Wriedt Larsen
5a032d6f84 Python: deprecate old taint-tracking related predicates 2022-02-04 12:02:08 +01:00
Rasmus Wriedt Larsen
dba6b60c80 Python: Deprecate old library modeling 2022-02-04 12:02:08 +01:00
Rasmus Wriedt Larsen
a40fdf7a7c Python: Deprecate old web modeling 2022-02-04 12:02:08 +01:00
Naman Jain
5e1ca3154f Update javascript/ql/test/query-tests/Security/CWE-754/UnvalidatedDynamicMethodCallGood3.js
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2022-02-04 16:13:05 +05:30
Naman Jain
5121414a53 Update javascript/ql/test/query-tests/Security/CWE-754/UnvalidatedDynamicMethodCallGood4.js
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2022-02-04 16:12:58 +05:30
Asger Feldthaus
0a0d9583b4 Ruby: rephase comment for MkDef 2022-02-04 11:37:54 +01:00
Asger Feldthaus
0189e8abb4 Ruby: autoformat 2022-02-04 11:32:31 +01:00
Asger Feldthaus
87c62db781 Ruby: disable test line not currently working 2022-02-04 11:20:42 +01:00
Asger Feldthaus
75b72361ce Ruby: add toString and locations to the new node types 2022-02-04 11:20:42 +01:00
Asger Feldthaus
7373a503f6 Ruby: Populate ArgumentPosition based on keyword arguments 2022-02-04 11:20:42 +01:00
Asger Feldthaus
5e350a0270 Ruby: Derive edge labels from {Argument,Parameter}Position 2022-02-04 11:20:42 +01:00
Asger Feldthaus
040e56623c Ruby: add getAValueReachingRhs 2022-02-04 11:20:42 +01:00
Asger Feldthaus
17dd5cd581 Ruby: remove a stray TODO 2022-02-04 11:20:42 +01:00
Asger Feldthaus
d2e381aa79 Ruby: more def-node tests 2022-02-04 11:20:41 +01:00
Asger Feldthaus
32e0f42969 Ruby: refactor Return(x) to Method(x).return 2022-02-04 11:20:39 +01:00
Asger Feldthaus
55b5f19b92 Ruby: Add def-nodes to API graphs 2022-02-04 11:06:35 +01:00
Asger Feldthaus
9c17a5ce99 Ruby: replace "instance" label with a call to new 2022-02-04 11:03:25 +01:00
Asger Feldthaus
5858732da1 Ruby: change useStep signature 2022-02-04 11:01:04 +01:00
Asger Feldthaus
e6fdd4d34a Ruby: Make hasLocalSource private/cached 2022-02-04 11:01:03 +01:00
Asger Feldthaus
9a496e647f Ruby: Drive-by fix type-tracking through params with default values 2022-02-04 11:01:03 +01:00
Jeroen Ketema
9f4e261625 Set precision of cpp/open-call-with-mode-argument to high 2022-02-04 10:01:25 +01:00
Jeroen Ketema
ef2a70e00c Limit open/openat target to global/std scope 2022-02-04 09:51:10 +01:00
Arthur Baars
6525035f0a Address comments 2022-02-03 13:47:03 +01:00
Jeroen Ketema
0b9b6d7b98 Address review comments 2022-02-03 12:09:18 +01:00
Jeroen Ketema
4d03082f16 Ensure that O_CREAT and O_TMPFILE are unique 2022-02-03 11:24:20 +01:00
Ian Wright
dca03d7b5d reinstate the AST node limit to minimize change to feature values 2022-02-03 09:45:35 +00:00
Ian Wright
d5ab119039 actually count the number of chars 2022-02-03 09:41:51 +00:00
Jeroen Ketema
e1ca5dd120 Simplify text in change note 2022-02-03 10:36:30 +01:00
Naman Jain
9809d30f00 file renaming and updated expected file 2022-02-03 09:35:17 +00:00
Naman Jain
adc8bf37fe fixed mistake in examples 2022-02-03 09:29:42 +00:00
Jeroen Ketema
5a2ce225f4 Check that all bits are set when checking for a flag
The `O_...` macro definitions somtimes set multiple bits, while
the bits individually represent the values of different `O_...`
macros. This lead to false postives on codebases built against
Musl libc, which defines `O_TMPFILE` as `020200000` and
`O_DIRECTORY` as `0200000`.
2022-02-03 10:29:13 +01:00
Harry Maclean
c65ca8ff86 Model calls to constantize as code executions
`constantize` is an ActiveSupport extension to `String` that attempts to
look up a constant with a name matching the receiver.
2022-02-03 15:22:07 +13:00
Harry Maclean
61cd05cfc5 Ruby: Ensure TRoute and TRouteBlock are private 2022-02-03 10:55:28 +13:00
Harry Maclean
80835a5a19 Ruby: Don't expose abstract class
Make ActionDispatch::Route into a private class
ActionDispatch::RouteImpl, defining a new class Route which exposes the
necessary public API from RouteImpl.

Also rename getHTTPMethod to getHttpMethod.
2022-02-03 10:41:30 +13:00
Harry Maclean
a8a7c156d0 via - update tests 2022-02-03 10:40:23 +13:00
Arthur Baars
a22868ba27 Merge branch 'main' into ruby-3.1 2022-02-02 19:00:03 +01:00
Jeroen Ketema
aa4651312e Fix naming conflicts in cpp/world-writable-file-creation 2022-02-02 17:36:14 +01:00
Jeroen Ketema
f32500306a Address review comments 2022-02-02 17:24:55 +01:00
Jeroen Ketema
0773ab37a5 Use matches to check for 0x prefix 2022-02-02 15:26:46 +01:00
Jeroen Ketema
92d9e51d2a Extract the value of O_CREAT and O_TMPFILE from the defining macro
There are operating systems that define `O_CREAT` with a different
value than Linux, which uses `0x40`. For example, OpenBSD uses `0x0200`.
Hence, we cannot use a hardcoded value.

Also handle `O_TMPFILE` while here.
2022-02-02 15:16:26 +01:00
Naman Jain
aea7054938 modified query and added tests 2022-02-02 19:39:08 +05:30
Jeroen Ketema
bd859d99bf Address review comments 2022-02-02 10:09:47 +01:00
Jeroen Ketema
5b8f56dcc6 Add change notes 2022-02-02 10:07:38 +01:00
Rasmus Lerchedahl Petersen
4ad99d9299 python: add missing QlDoc 2022-02-02 09:14:21 +01:00
Rasmus Lerchedahl Petersen
448e0785c2 python: logging.root is not a call 2022-02-02 09:04:16 +01:00
Harry Maclean
5adcdf1cf8 Ruby: Minor refactor 2022-02-02 17:32:11 +13:00
Harry Maclean
8f5380122a Ruby: Cache ActionDispatch IPA types 2022-02-02 17:31:47 +13:00
Harry Maclean
749dc092ae Ruby: Attempt to mitigate potential bad join
By joining simultaneously on controller class and name.
2022-02-02 17:03:46 +13:00
Harry Maclean
a38bc9fe89 Ruby Fix handling of via: in ActionDispatch 2022-02-02 17:03:27 +13:00
Harry Maclean
856c3d332c Minor cleanup to ActionDispatch modelling
`x.isStringOrSymbol(result)` is slightly terser than
`result = x.getStringOrSymbol()`.
2022-02-02 16:26:20 +13:00
Harry Maclean
47823b5a9a Handle via: :all in Rails routes
ActionDispatch modelling now understands that

    match "/foo", to: "foo#bar", via: :all

is equivalent to

    match "/foo",
      to: "foo#bar",
      via: [:get, :post, :put, :patch, :delete]
2022-02-02 16:26:20 +13:00
Harry Maclean
8bdc05ddaf getValueText -> getConstantValue 2022-02-02 16:26:20 +13:00
Harry Maclean
417287153b Ruby: QL style fixes 2022-02-02 16:26:20 +13:00
Harry Maclean
e975f92091 Ruby: remove unused predicate 2022-02-02 16:26:20 +13:00
Harry Maclean
3786fbfc7d Ruby: Rewrite ActionDispatch::underscore
This version is much shorter and hopefully performs a bit better.
2022-02-02 16:26:20 +13:00
Harry Maclean
eff2136f52 Ruby: remove unused predicate 2022-02-02 16:26:20 +13:00
Harry Maclean
dead7a8059 Ruby: Make most of ActionDispatch private
Any classes/predicates not used externally or in tests are now private.
Also fix some typos.
2022-02-02 16:26:20 +13:00
Harry Maclean
fa28e55645 Add a test for ActionDispatch::underscore
This shows how the predicate behaves, as well as a case where it goes
wrong.
2022-02-02 16:26:20 +13:00
Harry Maclean
9c67869875 Remove ActionDispatch::capitalize
This predicate isn't used.
2022-02-02 16:26:20 +13:00
Harry Maclean
ad71fdbb24 Add missing documentation to ActionDispatch::Route 2022-02-02 16:26:20 +13:00
Harry Maclean
1766916fc5 Ruby: Document ActionDispatch modelling 2022-02-02 16:26:20 +13:00
Harry Maclean
314683d5fb Ruby: Improve UrlRedirect query using Rails routes
Handlers for non-GET requests aren't vulnerable to URL redirect attacks,
because browsers won't initiate non-GET requests when you click a link.

We can use Rails routing information, if present, to filter out any
handlers for non-GET requests.
2022-02-02 16:26:20 +13:00
Harry Maclean
751d8a7f59 Ruby: Document getACapture 2022-02-02 16:26:20 +13:00
Harry Maclean
870c6d7412 Ruby: Rails route resolution
Add `Route` classes which model Rails routing information, typically
defined in a `routes.rb` file. We extract only the most basic
information: HTTP method, path, controller and action. This is enough to
determine whether a given controller method is a route handler, and what
HTTP method it handles, which is useful for, among other things, the URL
redirect query.
2022-02-02 16:26:19 +13:00
liangjinhuang
1dd15fa235 style:auto format 2022-02-02 01:30:54 +08:00
liangjinhuang
976e484c57 style:move all source files under src/experimental & feat:modify source regular matching rules 2022-02-02 01:14:51 +08:00
liangjinhuang
1885b683f7 style:formatDocument 2022-02-02 00:21:26 +08:00
liangjinhuang
af2e8ff8c6 feat:modify source regular matching rules 2022-02-02 00:10:15 +08:00
Jeroen Ketema
ff1c971100 Add query for missing mode argument in open/openat calls 2022-02-01 14:52:22 +01:00
Rasmus Lerchedahl Petersen
1e2428cb6b python: create LDAP module in Concepts 2022-02-01 14:39:58 +01:00
Rasmus Lerchedahl Petersen
c2cd58edc4 python: rewrite to separate configurations
source nodes get duplicated, so perhaps flow states
are actually better for performance?
2022-02-01 14:36:11 +01:00
Rasmus Lerchedahl Petersen
7df5c70c6f python: update frameworks.rst 2022-02-01 13:54:34 +01:00
Rasmus Lerchedahl Petersen
bec8c0daea python: update change note 2022-02-01 13:39:03 +01:00
Rasmus Lerchedahl Petersen
c587084758 python: use standard InstanceSource construction 2022-02-01 13:31:16 +01:00
museljh
012434b152 Update python/ql/src/experimental/Security/CWE-338/InsecureRandomness.ql
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2022-02-01 19:00:06 +08:00
museljh
a6002186bd Update python/ql/src/experimental/Security/CWE-338/InsecureRandomness.ql
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2022-02-01 18:59:12 +08:00
Jeroen Ketema
dbac927721 Take into account that the 4th argument of openat may be omitted
This matches what is done for `open`.
2022-02-01 11:41:07 +01:00
yoff
b120721942 Update python/ql/src/Security/CWE-090/LdapInjection.ql
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2022-02-01 11:02:47 +01:00
Rasmus Lerchedahl Petersen
119a7e4f34 python: provide links for Flask 2022-02-01 10:55:45 +01:00
Rasmus Lerchedahl Petersen
ecea392a08 python: rewrite qhelp overview
(combining the Java version and the JS version)
2022-02-01 10:47:18 +01:00
Rasmus Lerchedahl Petersen
26befebfc2 python: drop precision and add severity score
Given both the original FP score and our concerns
regarding sanitizers, `@precision medium`, which
is aligned with other languages, feels appropriate.
2022-02-01 10:34:36 +01:00
Rasmus Lerchedahl Petersen
7511b33512 python: "command" -> "log" 2022-02-01 10:23:16 +01:00
yoff
45f0bfd8f0 Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2022-02-01 10:06:37 +01:00
yoff
c03f89d712 Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2022-02-01 10:04:26 +01:00
Ian Wright
83ecc065ab restrict size of strings 2022-01-31 12:28:46 +00:00
Rasmus Lerchedahl Petersen
9d416664a1 python: modern change note
I set the category to newQuery since that is what users will see.
When we have tags, it would be nice to tag it as a query promotion.
2022-01-31 11:27:55 +01:00
Rasmus Lerchedahl Petersen
bf1145ece0 python: Add change note
should we have the `lgtm,codescanning` handshake or not?
2022-01-31 11:27:55 +01:00
Rasmus Lerchedahl Petersen
8b5114d10e python: Add standard customization setup
- modernize the sanitizer, but do not make it less specific
2022-01-31 11:27:55 +01:00
Rasmus Lerchedahl Petersen
20d54543fd python: move log injection out of experimental
- move from custom concept `LogOutput` to standard concept `Logging`
- remove `Log.qll` from experimental frameworks
  - fold models into standard models (naively for now)
    - stdlib:
      - make Logger module public
      - broaden definition of instance
      - add `extra` keyword as possible source
   - flak: add app.logger as logger instance
   - django: `add django.utils.log.request_logger` as logger instance
     (should we add the rest?)
- remove LogOutput from experimental concepts
2022-01-31 11:27:55 +01:00
Arthur Baars
abf3ce6223 Ruby: expressions in pin operator ^ 2022-01-28 19:47:31 +01:00
Arthur Baars
00fb4d3776 Ruby: Values in Hash literals and keyword arguments can be omitted 2022-01-28 19:47:31 +01:00
Arthur Baars
3e2ca61c01 Ruby: support anonymous block parameters/arguments 2022-01-28 19:47:31 +01:00
Arthur Baars
b9258e78ca Ruby: non-local variables in variable reference pattern 2022-01-28 19:47:31 +01:00
Arthur Baars
966b8be5f9 Ruby: add downgrade scripts 2022-01-28 19:47:31 +01:00
Arthur Baars
e5eb01ca45 Ruby: add upgrade scripts 2022-01-28 19:47:31 +01:00
Arthur Baars
c85012460a Ruby: update dbscheme stats 2022-01-28 19:47:31 +01:00
Arthur Baars
c6a36a50c2 Ruby: regenerate dbscheme and library 2022-01-28 19:47:31 +01:00
Arthur Baars
bfbc9fe144 Ruby: update tree-sitter-ruby 2022-01-28 19:47:25 +01:00
Alex Ford
57e958c372 Ruby: missing QLDoc 2022-01-28 17:38:55 +00:00
Alex Ford
269722fa86 Ruby: rb/clear-text-logging-sensitive-data changenote 2022-01-28 17:27:05 +00:00
Alex Ford
7fec2d270b Ruby: QL format 2022-01-28 17:24:56 +00:00
Alex Ford
186623f878 Ruby: Add CleartextLogging.qhelp 2022-01-28 17:24:56 +00:00
Alex Ford
7ed447842f Ruby: cleartext logging test output 2022-01-28 17:24:56 +00:00
Alex Ford
4fc9128350 Ruby: cleartext logging - remove an unnecessary abstract class 2022-01-28 17:24:56 +00:00
Alex Ford
91ccd307e8 Ruby: Implement rb/clear-text-logging-sensitive-data 2022-01-28 17:24:56 +00:00
Alex Ford
cfb2d7ffaf Ruby: add shared SensitiveDataHeuristics.qll 2022-01-28 16:38:58 +00:00
Ian Wright
aceeb7324c restrict AST nodes according to string length 2022-01-28 15:06:10 +00:00
Rasmus Lerchedahl Petersen
68d18ead34 python: add change note 2022-01-28 14:00:07 +01:00
Nick Rolfe
8248a942ce Ruby: enable taint checking for array-flow test 2022-01-28 11:33:59 +00:00
Nick Rolfe
c0e1384f4a Ruby: move Array/Enumerable flow summaries to their own file 2022-01-28 11:33:59 +00:00
Nick Rolfe
6c0eb8beee Ruby: update array flow summaries to use getConstantValue() 2022-01-28 11:33:59 +00:00
Nick Rolfe
693ff6a904 Ruby: add flow summaries for remaining Array methods 2022-01-28 11:33:59 +00:00
Nick Rolfe
030cfa36da Ruby: add flow summaries for all remaining Enumerable methods 2022-01-28 11:33:59 +00:00
Arthur Baars
cada7ef1a4 Ruby: add downgrade scripts to prepare-db-upgrade.sh 2022-01-28 11:07:56 +01:00
Rasmus Lerchedahl Petersen
ab43f041c3 python: rename files 2022-01-28 11:00:17 +01:00
Rasmus Lerchedahl Petersen
4c3c4deb34 python: Move over query and tests 2022-01-28 09:19:11 +01:00
Rasmus Lerchedahl Petersen
a026120c52 Python: Move configuration over and refine it
The original configuration did not match sinks with sanitizers.
Here it is resolved using flow state,
it could also be done by using two configurations.
2022-01-28 09:00:40 +01:00
Rasmus Lerchedahl Petersen
d539920661 Python: Update list of frameworks 2022-01-28 08:58:30 +01:00
Tamás Vajk
50f546043a Merge pull request #7769 from github/release-prep/2.8.0
Release preparation for version 2.8.0
2022-01-27 13:36:59 +01:00
Tamás Vajk
3d2cc8890a Update CHANGELOG.md 2022-01-27 11:50:13 +01:00
Tamás Vajk
cc4bb9b02f Update 0.0.8.md 2022-01-27 11:49:29 +01:00
github-actions[bot]
634134f283 Release preparation for version 2.8.0 2022-01-27 10:40:20 +00:00
Rasmus Lerchedahl Petersen
163c888781 python: port concepts and implementations 2022-01-26 19:05:37 +01:00
Rasmus Lerchedahl Petersen
e6b5833bd6 python: fix typo in qhelp 2022-01-26 19:05:36 +01:00
luchua-bc
27043a09b3 File path injection with the JFinal framework 2022-01-23 18:07:48 +00:00
Erik Krogh Kristensen
548fb47603 JS: move ExternalArtifact.qll into lib/ folder to fix ql/db-type-outside-core 2022-01-20 14:00:57 +01:00
Erik Krogh Kristensen
9b69de8588 QL: add query detecting use of db-types outside the lib folder 2022-01-20 14:00:55 +01:00
Asger Feldthaus
79f799066a JS: Update test output 2022-01-17 16:27:57 +01:00
Artem Smotrakov
825fe1797a Fixed another false-positive in CWE-297/IgnoredHostnameVerification.ql 2022-01-16 18:55:49 +00:00
Artem Smotrakov
6dad0e21d9 Ignore wrapped HostnameVerifier.vefify() calls 2022-01-16 18:29:30 +00:00
Artem Smotrakov
dcf251bb93 Fixed typos in IgnoredHostnameVerification.qhelp 2022-01-16 18:27:49 +00:00
Fosstars
2b33265d0f Added a query for ignored hostname verification
- Added IgnoredHostnameVerification.ql
- Added a qhelp file with examples
- Added tests
2022-01-16 18:27:49 +00:00
Artem Smotrakov
f78002bc02 Fixed a false-positive in CWE-297/IgnoredHostnameVerification.ql 2022-01-16 18:25:18 +00:00
Fosstars
e11cb943a6 Added a query for ignored hostname verification
- Added IgnoredHostnameVerification.ql
- Added a qhelp file with examples
- Added tests
2022-01-16 18:25:18 +00:00
Asger Feldthaus
708408a458 JS: Recognize "sql" option as a query string 2022-01-13 13:04:41 +01:00
Henry Mercer
19933262c4 Java: Fix copy/paste error in existing queries
Co-authored-by: yo-h <55373593+yo-h@users.noreply.github.com>
2022-01-05 10:50:22 +00:00
jorgectf
1f1b7a54f8 Update .expected 2021-12-19 18:58:43 +01:00
jorgectf
b6bdcd0eb8 Delete redundant exists() 2021-12-19 18:57:22 +01:00
jorgectf
98c8503ebd Fix test mismatch 2021-12-19 18:35:53 +01:00
jorgectf
f82ed8573e Model python_jwt.process_jwt 2021-12-19 18:32:14 +01:00
Henry Mercer
5696146179 Java: Convert telemetry queries to summary metrics
Use the support for summary metrics with messages that'll be in the next
version of the CodeQL CLI.
2021-12-15 17:59:01 +00:00
liangjinhuang
77b5f422ba change PasswordFnSink to RandomFnSink 2021-12-11 12:31:20 +08:00
liangjinhuang
1102f60f3e add tests 2021-12-04 00:52:15 +08:00
liangjinhuang
d0ac11817e add insecureRandomness 2021-11-28 20:47:06 +08:00
1097 changed files with 113361 additions and 44156 deletions

View File

@@ -4,6 +4,7 @@
"*/ql/lib/qlpack.yml",
"*/ql/test/qlpack.yml",
"*/ql/examples/qlpack.yml",
"*/ql/consistency-queries/qlpack.yml",
"cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/qlpack.yml",
"javascript/ql/experimental/adaptivethreatmodeling/lib/qlpack.yml",
"javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/qlpack.yml",
@@ -14,8 +15,6 @@
"misc/legacy-support/*/qlpack.yml",
"misc/suite-helpers/qlpack.yml",
"ruby/extractor-pack/codeql-extractor.yml",
"ruby/ql/consistency-queries/qlpack.yml",
"ql/ql/consistency-queries/qlpack.yml",
"ql/extractor-pack/codeql-extractor.yml"
],
"versionPolicies": {

6
.gitattributes vendored
View File

@@ -52,6 +52,12 @@
java/ql/test/stubs/**/*.java linguist-generated=true
java/ql/test/experimental/stubs/**/*.java linguist-generated=true
# For some languages, upgrade script testing references really old dbscheme
# files from legacy upgrades that have CRLF line endings. Since upgrade
# resolution relies on object hashes, we must suppress line ending conversion
# for those testing dbscheme files.
*/ql/lib/upgrades/initial/*.dbscheme -text
# Generated test files - these are synced from the standard JavaScript libraries using
# `javascript/ql/experimental/adaptivethreatmodeling/test/update_endpoint_test_files.py`.
javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/autogenerated/**/*.js linguist-generated=true -merge

View File

@@ -6,8 +6,11 @@ on:
paths:
- "*/ql/src/**/*.ql"
- "*/ql/src/**/*.qll"
- "*/ql/lib/**/*.ql"
- "*/ql/lib/**/*.qll"
- "!**/experimental/**"
- "!ql/**"
- ".github/workflows/check-change-note.yml"
jobs:
check-change-note:

View File

@@ -0,0 +1,43 @@
name: "Publish framework coverage as metrics"
on:
schedule:
- cron: '5 0 * * *'
push:
branches:
- main
workflow_dispatch:
pull_request:
branches:
- main
paths:
- ".github/workflows/csv-coverage-metrics.yml"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup CodeQL
uses: ./.github/actions/fetch-codeql
- name: Create empty database
run: |
DATABASE="${{ runner.temp }}/java-database"
PROJECT="${{ runner.temp }}/java-project"
mkdir -p "$PROJECT/src/tmp/empty"
echo "class Empty {}" >> "$PROJECT/src/tmp/empty/Empty.java"
codeql database create "$DATABASE" --language=java --source-root="$PROJECT" --command 'javac src/tmp/empty/Empty.java'
- name: Capture coverage information
run: |
DATABASE="${{ runner.temp }}/java-database"
codeql database analyze --format=sarif-latest --output=metrics.sarif -- "$DATABASE" ./java/ql/src/Metrics/Summaries/FrameworkCoverage.ql
- uses: actions/upload-artifact@v2
with:
name: metrics.sarif
path: metrics.sarif
retention-days: 20
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: metrics.sarif

View File

@@ -39,6 +39,12 @@ jobs:
- uses: ./.github/actions/fetch-codeql
- name: Install pack dependencies
run: |
for pack in modelbuilding src; do
codeql pack install --mode verify -- "${pack}"
done
- name: Check QL compilation
run: |
codeql query compile \
@@ -57,6 +63,9 @@ jobs:
- uses: ./.github/actions/fetch-codeql
- name: Install pack dependencies
run: codeql pack install -- test
- name: Run QL tests
run: |
codeql test run \

View File

@@ -31,13 +31,13 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ runner.temp }}/query-pack.zip
key: queries-${{ hashFiles('ql/**/*.ql*') }}-${{ hashFiles('ql/ql/src/ql.dbscheme*') }}-${{ steps.get-codeql-version.outputs.version }}
key: queries-${{ hashFiles('ql/**/*.ql*') }}-${{ hashFiles('ql/**/qlpack.yml') }}-${{ hashFiles('ql/ql/src/ql.dbscheme*') }}-${{ steps.get-codeql-version.outputs.version }}
- name: Build query pack
if: steps.cache-queries.outputs.cache-hit != 'true'
run: |
cd ql/ql/src
"${CODEQL}" pack create
cd .codeql/pack/codeql/ql-all/0.0.0
cd .codeql/pack/codeql/ql/0.0.0
zip "${PACKZIP}" -r .
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}

View File

@@ -52,6 +52,14 @@ jobs:
codeql dataset import -S ql/lib/upgrades/initial/ruby.dbscheme testdb empty.trap
codeql dataset upgrade testdb --additional-packs ql/lib
diff -q testdb/ruby.dbscheme ql/lib/ruby.dbscheme
- name: Check DB downgrade scripts
run: |
echo >empty.trap
rm -rf testdb; codeql dataset import -S ql/lib/ruby.dbscheme testdb empty.trap
codeql resolve upgrades --format=lines --allow-downgrades --additional-packs downgrades \
--dbscheme=ql/lib/ruby.dbscheme --target-dbscheme=downgrades/initial/ruby.dbscheme |
xargs codeql execute upgrades testdb
diff -q testdb/ruby.dbscheme downgrades/initial/ruby.dbscheme
qltest:
runs-on: ubuntu-latest
strategy:

View File

@@ -0,0 +1,29 @@
name: Validate change notes
on:
push:
paths:
- "*/ql/*/change-notes/**/*"
- ".github/workflows/validate-change-notes.yml"
branches:
- main
- "rc/*"
pull_request:
paths:
- "*/ql/*/change-notes/**/*"
- ".github/workflows/validate-change-notes.yml"
jobs:
check-change-note:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup CodeQL
uses: ./.github/actions/fetch-codeql
- name: Fail if there are any errors with existing change notes
run: |
codeql pack release --groups cpp,csharp,java,javascript,python,ruby,-examples,-test,-experimental

View File

@@ -13,6 +13,9 @@
/python/**/experimental/**/* @github/codeql-python @xcorail
/ruby/**/experimental/**/* @github/codeql-ruby @xcorail
# ML-powered queries
/javascript/ql/experimental/adaptivethreatmodeling/ @github/codeql-ml-powered-queries-reviewers
# Notify members of codeql-go about PRs to the shared data-flow library files
/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl.qll @github/codeql-java @github/codeql-go
/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl2.qll @github/codeql-java @github/codeql-go
@@ -27,4 +30,4 @@
/docs/query-*-style-guide.md @github/codeql-analysis-reviewers
# QL for QL reviewers
/ql/ @github/codeql-ql-for-ql-reviewers
/ql/ @github/codeql-ql-for-ql-reviewers

View File

@@ -1,51 +0,0 @@
# benjamin-buttons.md
This file describes the changes that have been applied to
the library to make it behave as if it was younger.
## TaintedPath.ql
Sinks added between 2020-01-01 and 2020-10-06 have been removed. Found by looking at:
- the commit titles of https://github.com/github/codeql/commits/main/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected
- the PR titles of https://github.com/github/codeql/pulls?page=2&q=is%3Apr+label%3AJS+is%3Aclosed+sink
Sinks added between 2018-08-02 and 2020-01-01 have been removed. Found by looking at:
- the commit titles of https://github.com/github/codeql/commits/main/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected
- the PR titles of https://github.com/github/codeql/pulls?page=2&q=is%3Apr+label%3AJS+is%3Aclosed+sink
- the PR titles of https://github.com/github/codeql/pulls?page=2&q=is%3Apr+label%3AJS+is%3Aclosed+pathinjection
- the PR titles of https://github.com/github/codeql/pulls?page=2&q=is%3Apr+label%3AJS+is%3Aclosed+tainted-path
Sinks from the "graceful-fs" and "fs-extra" (added before the open-sourcing squash).
## Xss.ql
Sinks added between 2020-01-01 and 2020-10-06 have been removed. Found by looking at:
- the commit titles of https://github.com/github/codeql/commits/main/javascript/ql/test/query-tests/Security/CWE-079/Xss.expected
- the PR titles of https://github.com/github/codeql/pulls?page=2&q=is%3Apr+label%3AJS+is%3Aclosed+sink
- recursive type tracking for `jQuery::dollar`, `DOM::domValueRef`.
## SqlInjection.ql
Sinks added between 2020-01-01 and 2020-10-06 have been removed. Found by looking at:
- the commit titles of https://github.com/github/codeql/commits/main/javascript/ql/test/query-tests/Security/CWE-089
- the PR titles of https://github.com/github/codeql/pulls?page=2&q=is%3Apr+label%3AJS+is%3Aclosed+sink
Sinks added between 2018-08-02 and 2020-01-01 have been removed. Found by looking at:
- the commit titles of https://github.com/github/codeql/commits/main/javascript/ql/test/query-tests/Security/CWE-089
- the PR titles of https://github.com/github/codeql/pulls?page=2&q=is%3Apr+label%3AJS+is%3Aclosed+sink
- the PR titles of https://github.com/github/codeql/pulls?page=2&q=is%3Apr+label%3AJS+is%3Aclosed+sql
TypeTracking in SQL.qll (added before the open-sourcing squash)
The model of `mssql` and `sequelize` (added before the open-sourcing squash)
## PseudoProperties
Pseudo-properties (`$name$`) used in type-tracking and global dataflow configurations have been disabled.
Found by searching for `"\$.*\$"`.

View File

@@ -465,7 +465,8 @@
],
"SensitiveDataHeuristics Python/JS": [
"javascript/ql/lib/semmle/javascript/security/internal/SensitiveDataHeuristics.qll",
"python/ql/lib/semmle/python/security/internal/SensitiveDataHeuristics.qll"
"python/ql/lib/semmle/python/security/internal/SensitiveDataHeuristics.qll",
"ruby/ql/lib/codeql/ruby/security/internal/SensitiveDataHeuristics.qll"
],
"ReDoS Util Python/JS/Ruby": [
"javascript/ql/lib/semmle/javascript/security/performance/ReDoSUtil.qll",
@@ -501,5 +502,11 @@
"javascript/ql/lib/tutorial.qll",
"python/ql/lib/tutorial.qll",
"ruby/ql/lib/tutorial.qll"
],
"AccessPathSyntax": [
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/AccessPathSyntax.qll",
"java/ql/lib/semmle/code/java/dataflow/internal/AccessPathSyntax.qll",
"javascript/ql/lib/semmle/javascript/frameworks/data/internal/AccessPathSyntax.qll",
"ruby/ql/lib/codeql/ruby/dataflow/internal/AccessPathSyntax.qll"
]
}

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: Remove unused legacy relations
compatibility: backwards

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: Add relation for tracking variables from structured binding declarations
compatibility: full
is_structured_binding.rel: delete

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
name: codeql/cpp-downgrades
groups: cpp
downgrades: .
library: true

View File

@@ -1,3 +1,22 @@
## 0.0.10
### New Features
* Added a `isStructuredBinding` predicate to the `Variable` class which holds when the variable is declared as part of a structured binding declaration.
## 0.0.9
## 0.0.8
### Deprecated APIs
* The `codeql/cpp-upgrades` CodeQL pack has been removed. All upgrades scripts have been merged into the `codeql/cpp-all` CodeQL pack.
### Minor Analysis Improvements
* `FormatLiteral::getMaxConvertedLength` now uses range analysis to provide a
more accurate length for integers formatted with `%x`
## 0.0.7
## 0.0.6

View File

@@ -1,4 +0,0 @@
---
category: deprecated
---
* The `codeql/cpp-upgrades` CodeQL pack has been removed. All upgrades scripts have been merged into the `codeql/cpp-all` CodeQL pack.

View File

@@ -1,5 +0,0 @@
---
category: minorAnalysis
---
* `FormatLiteral::getMaxConvertedLength` now uses range analysis to provide a
more accurate length for integers formatted with `%x`

View File

@@ -0,0 +1,5 @@
## 0.0.10
### New Features
* Added a `isStructuredBinding` predicate to the `Variable` class which holds when the variable is declared as part of a structured binding declaration.

View File

@@ -0,0 +1,10 @@
## 0.0.8
### Deprecated APIs
* The `codeql/cpp-upgrades` CodeQL pack has been removed. All upgrades scripts have been merged into the `codeql/cpp-all` CodeQL pack.
### Minor Analysis Improvements
* `FormatLiteral::getMaxConvertedLength` now uses range analysis to provide a
more accurate length for integers formatted with `%x`

View File

@@ -0,0 +1,2 @@
## 0.0.9

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.0.7
lastReleaseVersion: 0.0.10

View File

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

View File

@@ -169,6 +169,12 @@ class Variable extends Declaration, @variable {
variable_instantiation(underlyingElement(this), unresolveElement(v))
}
/**
* Holds if this variable is declated as part of a structured binding
* declaration. For example, `x` in `auto [x, y] = ...`.
*/
predicate isStructuredBinding() { is_structured_binding(underlyingElement(this)) }
/**
* Holds if this is a compiler-generated variable. For example, a
* [range-based for loop](http://en.cppreference.com/w/cpp/language/range-for)

View File

@@ -11,10 +11,10 @@ import cpp
*/
bindingset[input]
int parseOctal(string input) {
input.charAt(0) = "0" and
input.regexpMatch("0[0-7]+") and
result =
strictsum(int ix |
ix in [0 .. input.length()]
ix in [1 .. input.length()]
|
8.pow(input.length() - (ix + 1)) * input.charAt(ix).toInt()
)

View File

@@ -353,9 +353,9 @@ module FlowVar_internal {
// indirection.
result = def.getAUse(v)
or
exists(SsaDefinition descendentDef |
this.getASuccessorSsaVar+() = TSsaVar(descendentDef, _) and
result = descendentDef.getAUse(v)
exists(SsaDefinition descendantDef |
this.getASuccessorSsaVar+() = TSsaVar(descendantDef, _) and
result = descendantDef.getAUse(v)
)
)
or

View File

@@ -200,7 +200,7 @@ class IRBlock extends IRBlockBase {
* post-dominate block `B`, but block `A` does post-dominate an immediate successor of block `B`.
*/
pragma[noinline]
final IRBlock postPominanceFrontier() {
final IRBlock postDominanceFrontier() {
this.postDominates(result.getASuccessor()) and
not this.strictlyPostDominates(result)
}

View File

@@ -200,7 +200,7 @@ class IRBlock extends IRBlockBase {
* post-dominate block `B`, but block `A` does post-dominate an immediate successor of block `B`.
*/
pragma[noinline]
final IRBlock postPominanceFrontier() {
final IRBlock postDominanceFrontier() {
this.postDominates(result.getASuccessor()) and
not this.strictlyPostDominates(result)
}

View File

@@ -200,7 +200,7 @@ class IRBlock extends IRBlockBase {
* post-dominate block `B`, but block `A` does post-dominate an immediate successor of block `B`.
*/
pragma[noinline]
final IRBlock postPominanceFrontier() {
final IRBlock postDominanceFrontier() {
this.postDominates(result.getASuccessor()) and
not this.strictlyPostDominates(result)
}

View File

@@ -135,52 +135,11 @@ externalData(
string value : string ref
);
/**
* The date of the snapshot.
*/
snapshotDate(unique date snapshotDate : date ref);
/**
* The source location of the snapshot.
*/
sourceLocationPrefix(string prefix : string ref);
/**
* Data used by the 'duplicate code' detection.
*/
duplicateCode(
unique int id : @duplication,
string relativePath : string ref,
int equivClass : int ref
);
/**
* Data used by the 'similar code' detection.
*/
similarCode(
unique int id : @similarity,
string relativePath : string ref,
int equivClass : int ref
);
/**
* Data used by the 'duplicate code' and 'similar code' detection.
*/
@duplication_or_similarity = @duplication | @similarity
/**
* Data used by the 'duplicate code' and 'similar code' detection.
*/
#keyset[id, offset]
tokens(
int id : @duplication_or_similarity ref,
int offset : int ref,
int beginLine : int ref,
int beginColumn : int ref,
int endLine : int ref,
int endColumn : int ref
);
/**
* Information about packages that provide code used during compilation.
* The `id` is just a unique identifier.
@@ -487,6 +446,7 @@ var_decl_specifiers(
int id: @var_decl ref,
string name: string ref
)
is_structured_binding(unique int id: @variable ref);
type_decls(
unique int id: @type_decl,

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,6 @@
description: Remove unused legacy relations
compatibility: full
snapshotDate.rel: delete
duplicateCode.rel: delete
similarCode.rel: delete
tokens.rel: delete

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Add relation for tracking variables from structured binding declarations
compatibility: backwards

File diff suppressed because it is too large Load Diff

View File

@@ -18,7 +18,6 @@ where
not lv1.isCompilerGenerated() and
not lv2.isCompilerGenerated() and
not lv1.getParentScope().(BlockStmt).isInMacroExpansion() and
not lv2.getParentScope().(BlockStmt).isInMacroExpansion() and
not lv1.getName() = "(unnamed local variable)"
not lv2.getParentScope().(BlockStmt).isInMacroExpansion()
select lv1, "Variable " + lv1.getName() + " hides another variable of the same name (on $@).", lv2,
"line " + lv2.getLocation().getStartLine().toString()

View File

@@ -1,3 +1,42 @@
## 0.0.10
### Deprecated Classes
* The `CodeDuplication.Copy`, `CodeDuplication.DuplicateBlock`, and `CodeDuplication.SimilarBlock` classes have been deprecated.
## 0.0.9
### New Queries
* Added a new query, `cpp/open-call-with-mode-argument`, to detect when `open` or `openat` is called with the `O_CREAT` or `O_TMPFILE` flag but when the `mode` argument is omitted.
### Minor Analysis Improvements
* The "Cleartext transmission of sensitive information" (`cpp/cleartext-transmission`) query has been further improved to reduce false positive results, and upgraded from `medium` to `high` precision.
* The "Cleartext transmission of sensitive information" (`cpp/cleartext-transmission`) query now finds more results, where a password is stored in a struct field or class member variable.
* The `cpp/cleartext-storage-file` query has been improved, removing false positives where data is written to a standard output stream.
* The `cpp/cleartext-storage-buffer` query has been updated to use the `semmle.code.cpp.dataflow.TaintTracking` library.
* The `cpp/world-writable-file-creation` query now only detects `open` and `openat` calls with the `O_CREAT` or `O_TMPFILE` flag.
## 0.0.8
### New Queries
* The `security` tag has been added to the `cpp/return-stack-allocated-memory` query. As a result, its results will now appear by default.
* The "Uncontrolled data in arithmetic expression" (cpp/uncontrolled-arithmetic) query has been enhanced to reduce false positive results and its @precision increased to high.
* A new `cpp/very-likely-overruning-write` query has been added to the default query suite for C/C++. The query reports some results that were formerly flagged by `cpp/overruning-write`.
### Minor Analysis Improvements
* Fix an issue with the `cpp/declaration-hides-variable` query where it would report variables that are unnamed in a database.
* The `cpp/cleartext-storage-file` query has been upgraded with non-local taint flow and has been converted to a `path-problem` query.
* The `cpp/return-stack-allocated-memory` query has been improved to produce fewer false positives. The
query has also been converted to a `path-problem` query.
* The "Cleartext transmission of sensitive information" (`cpp/cleartext-transmission`) query has been improved in several ways to reduce false positive results.
* The "Potential improper null termination" (`cpp/improper-null-termination`) query now produces fewer false positive results around control flow branches and loops.
* Added exception for GLib's gboolean to cpp/ambiguously-signed-bit-field.
This change reduces the number of false positives in the query.
## 0.0.7
## 0.0.6

View File

@@ -168,6 +168,16 @@ class NetworkRecv extends NetworkSendRecv {
override Recv target;
}
pragma[noinline]
predicate encryptionFunction(Function f) {
f.getName().toLowerCase().regexpMatch(".*(crypt|encode|decode|hash|securezero).*")
}
pragma[noinline]
predicate encryptionType(UserType t) {
t.getName().toLowerCase().regexpMatch(".*(crypt|encode|decode|hash|securezero).*")
}
/**
* An expression that is an argument or return value from an encryption /
* decryption call. This is quite inclusive to minimize false positives, for
@@ -177,10 +187,7 @@ class NetworkRecv extends NetworkSendRecv {
class Encrypted extends Expr {
Encrypted() {
exists(FunctionCall fc |
fc.getTarget()
.getName()
.toLowerCase()
.regexpMatch(".*(crypt|encode|decode|hash|securezero).*") and
encryptionFunction(fc.getTarget()) and
(
this = fc or
this = fc.getAnArgument()
@@ -189,7 +196,7 @@ class Encrypted extends Expr {
or
exists(Type t |
this.getType().refersTo(t) and
t.getName().toLowerCase().regexpMatch(".*(crypt|encode|decode|hash|securezero).*")
encryptionType(t)
)
}
}

View File

@@ -12,17 +12,16 @@
import cpp
import FilePermissions
import semmle.code.cpp.commons.unix.Constants
predicate worldWritableCreation(FileCreationExpr fc, int mode) {
mode = localUmask(fc).mask(fc.getMode()) and
sets(mode, s_iwoth())
setsAnyBits(mode, UnixConstants::s_iwoth())
}
predicate setWorldWritable(FunctionCall fc, int mode) {
fc.getTarget().getName() = ["chmod", "fchmod", "_chmod", "_wchmod"] and
mode = fc.getArgument(1).getValue().toInt() and
sets(mode, s_iwoth())
setsAnyBits(mode, UnixConstants::s_iwoth())
}
from Expr fc, int mode, string message

View File

@@ -1,5 +1,49 @@
import cpp
import semmle.code.cpp.commons.unix.Constants
import semmle.code.cpp.commons.unix.Constants as UnixConstants
/**
* Gets the number corresponding to the contents of `input` in base-16.
* Note: the first two characters of `input` must be `0x`. For example:
* `parseHex("0x123abc") = 1194684`.
*/
bindingset[input]
int parseHex(string input) {
exists(string lowerCaseInput | lowerCaseInput = input.toLowerCase() |
lowerCaseInput.regexpMatch("0x[0-9a-f]+") and
result =
strictsum(int ix |
ix in [2 .. input.length()]
|
16.pow(input.length() - (ix + 1)) * "0123456789abcdef".indexOf(lowerCaseInput.charAt(ix))
)
)
}
/**
* Gets the value defined by the `O_CREAT` macro if the macro
* exists and if every definition defines the same value.
*/
int o_creat() {
result =
unique(int v |
exists(Macro m | m.getName() = "O_CREAT" |
v = parseHex(m.getBody()) or v = UnixConstants::parseOctal(m.getBody())
)
)
}
/**
* Gets the value defined by the `O_TMPFILE` macro if the macro
* exists and if every definition defines the same value.
*/
int o_tmpfile() {
result =
unique(int v |
exists(Macro m | m.getName() = "O_TMPFILE" |
v = parseHex(m.getBody()) or v = UnixConstants::parseOctal(m.getBody())
)
)
}
bindingset[n, digit]
private string octalDigit(int n, int digit) {
@@ -20,11 +64,17 @@ string octalFileMode(int mode) {
else result = "[non-standard mode: decimal " + mode + "]"
}
/**
* Holds if the bitmask `value` sets the bits in `flag`.
*/
bindingset[value, flag]
predicate setsFlag(int value, int flag) { value.bitAnd(flag) = flag }
/**
* Holds if the bitmask `mask` sets any of the bit fields in `fields`.
*/
bindingset[mask, fields]
predicate sets(int mask, int fields) { mask.bitAnd(fields) != 0 }
predicate setsAnyBits(int mask, int fields) { mask.bitAnd(fields) != 0 }
/**
* Gets the value that `fc` sets the umask to, if `fc` is a call to
@@ -83,16 +133,24 @@ abstract class FileCreationExpr extends FunctionCall {
abstract int getMode();
}
class OpenCreationExpr extends FileCreationExpr {
abstract class FileCreationWithOptionalModeExpr extends FileCreationExpr {
abstract predicate hasModeArgument();
}
class OpenCreationExpr extends FileCreationWithOptionalModeExpr {
OpenCreationExpr() {
this.getTarget().getName() = ["open", "_open", "_wopen"] and
sets(this.getArgument(1).getValue().toInt(), o_creat())
this.getTarget().hasGlobalOrStdName(["open", "_open", "_wopen"]) and
exists(int flag | flag = this.getArgument(1).getValue().toInt() |
setsFlag(flag, o_creat()) or setsFlag(flag, o_tmpfile())
)
}
override Expr getPath() { result = this.getArgument(0) }
override predicate hasModeArgument() { exists(this.getArgument(2)) }
override int getMode() {
if exists(this.getArgument(2))
if this.hasModeArgument()
then result = this.getArgument(2).getValue().toInt()
else
// assume anything is permitted
@@ -108,20 +166,35 @@ class CreatCreationExpr extends FileCreationExpr {
override int getMode() { result = this.getArgument(1).getValue().toInt() }
}
class OpenatCreationExpr extends FileCreationExpr {
class OpenatCreationExpr extends FileCreationWithOptionalModeExpr {
OpenatCreationExpr() {
this.getTarget().getName() = "openat" and
this.getNumberOfArguments() = 4
this.getTarget().hasGlobalOrStdName("openat") and
exists(int flag | flag = this.getArgument(2).getValue().toInt() |
setsFlag(flag, o_creat()) or setsFlag(flag, o_tmpfile())
)
}
override Expr getPath() { result = this.getArgument(1) }
override int getMode() { result = this.getArgument(3).getValue().toInt() }
override predicate hasModeArgument() { exists(this.getArgument(3)) }
override int getMode() {
if this.hasModeArgument()
then result = this.getArgument(3).getValue().toInt()
else
// assume anything is permitted
result = 0.bitNot()
}
}
private int fopenMode() {
result =
s_irusr().bitOr(s_irgrp()).bitOr(s_iroth()).bitOr(s_iwusr()).bitOr(s_iwgrp()).bitOr(s_iwoth())
UnixConstants::s_irusr()
.bitOr(UnixConstants::s_irgrp())
.bitOr(UnixConstants::s_iroth())
.bitOr(UnixConstants::s_iwusr())
.bitOr(UnixConstants::s_iwgrp())
.bitOr(UnixConstants::s_iwoth())
}
class FopenCreationExpr extends FileCreationExpr {
@@ -153,6 +226,6 @@ class FopensCreationExpr extends FileCreationExpr {
// fopen_s has restrictive permissions unless you have "u" in the mode
if this.getArgument(2).getValue().charAt(_) = "u"
then result = fopenMode()
else result = s_irusr().bitOr(s_iwusr())
else result = UnixConstants::s_irusr().bitOr(UnixConstants::s_iwusr())
}
}

View File

@@ -0,0 +1,9 @@
int open_file_bad() {
// BAD - this uses arbitrary bytes from the stack as mode argument
return open(FILE, O_CREAT)
}
int open_file_good() {
// GOOD - the mode argument is supplied
return open(FILE, O_CREAT, S_IRUSR | S_IWUSR)
}

View File

@@ -0,0 +1,31 @@
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>
When opening a file with the <code>O_CREAT</code> or <code>O_TMPFILE</code> flag, the <code>mode</code> must
be supplied. If the <code>mode</code> argument is omitted, some arbitrary bytes from the stack will be used
as the file mode. This leaks some bits from the stack into the permissions of the file.
</p>
</overview>
<recommendation>
<p>
The <code>mode</code> must be supplied when <code>O_CREAT</code> or <code>O_TMPFILE</code> is specified.
</p>
</recommendation>
<example>
<p>
The first example opens a file with the <code>O_CREAT</code> flag without supplying the <code>mode</code>
argument. In this case arbitrary bytes from the stack will be used as <code>mode</code> argument. The
second example correctly supplies the <code>mode</code> argument and creates a file that is user readable
and writable.
</p>
<sample src="OpenCallMissingModeArgument.c" />
</example>
</qhelp>

View File

@@ -0,0 +1,19 @@
/**
* @name File opened with O_CREAT flag but without mode argument
* @description Opening a file with the O_CREAT flag but without mode argument reads arbitrary bytes from the stack.
* @kind problem
* @problem.severity error
* @security-severity 7.8
* @precision high
* @id cpp/open-call-with-mode-argument
* @tags security
* external/cwe/cwe-732
*/
import cpp
import FilePermissions
from FileCreationWithOptionalModeExpr fc
where not fc.hasModeArgument()
select fc,
"A file is created here without providing a mode argument, which may leak bits from the stack."

View File

@@ -1,4 +0,0 @@
---
category: newQuery
---
* A new `cpp/very-likely-overruning-write` query has been added to the default query suite for C/C++. The query reports some results that were formerly flagged by `cpp/overruning-write`.

View File

@@ -1,5 +0,0 @@
---
category: minorAnalysis
---
* Added exception for GLib's gboolean to cpp/ambiguously-signed-bit-field.
This change reduces the number of false positives in the query.

View File

@@ -1,4 +0,0 @@
---
category: newQuery
---
* The "Uncontrolled data in arithmetic expression" (cpp/uncontrolled-arithmetic) query has been enhanced to reduce false positive results and its @precision increased to high.

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* The "Potential improper null termination" (`cpp/improper-null-termination`) query now produces fewer false positive results around control flow branches and loops.

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* The "Cleartext transmission of sensitive information" (`cpp/cleartext-transmission`) query has been improved in several ways to reduce false positive results.

View File

@@ -1,5 +0,0 @@
---
category: minorAnalysis
---
* The `cpp/return-stack-allocated-memory` query has been improved to produce fewer false positives. The
query has also been converted to a `path-problem` query.

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* The "Cleartext transmission of sensitive information" (`cpp/cleartext-transmission`) query now finds more results, where a password is stored in a struct field or class member variable.

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* The `cpp/cleartext-storage-file` query has been upgraded with non-local taint flow and has been converted to a `path-problem` query.

View File

@@ -1,4 +0,0 @@
---
category: newQuery
---
* The `security` tag has been added to the `cpp/return-stack-allocated-memory` query. As a result, its results will now appear by default.

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* The `cpp/cleartext-storage-buffer` query has been updated to use the `semmle.code.cpp.dataflow.TaintTracking` library.

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* Fix an issue with the `cpp/declaration-hides-variable` query where it would report variables that are unnamed in a database.

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* The `cpp/cleartext-storage-file` query has been improved, removing false positives where data is written to a standard output stream.

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* The "Cleartext transmission of sensitive information" (`cpp/cleartext-transmission`) query has been further improved to reduce false positive results, and upgraded from `medium` to `high` precision.

View File

@@ -0,0 +1,5 @@
## 0.0.10
### Deprecated Classes
* The `CodeDuplication.Copy`, `CodeDuplication.DuplicateBlock`, and `CodeDuplication.SimilarBlock` classes have been deprecated.

View File

@@ -0,0 +1,18 @@
## 0.0.8
### New Queries
* The `security` tag has been added to the `cpp/return-stack-allocated-memory` query. As a result, its results will now appear by default.
* The "Uncontrolled data in arithmetic expression" (cpp/uncontrolled-arithmetic) query has been enhanced to reduce false positive results and its @precision increased to high.
* A new `cpp/very-likely-overruning-write` query has been added to the default query suite for C/C++. The query reports some results that were formerly flagged by `cpp/overruning-write`.
### Minor Analysis Improvements
* Fix an issue with the `cpp/declaration-hides-variable` query where it would report variables that are unnamed in a database.
* The `cpp/cleartext-storage-file` query has been upgraded with non-local taint flow and has been converted to a `path-problem` query.
* The `cpp/return-stack-allocated-memory` query has been improved to produce fewer false positives. The
query has also been converted to a `path-problem` query.
* The "Cleartext transmission of sensitive information" (`cpp/cleartext-transmission`) query has been improved in several ways to reduce false positive results.
* The "Potential improper null termination" (`cpp/improper-null-termination`) query now produces fewer false positive results around control flow branches and loops.
* Added exception for GLib's gboolean to cpp/ambiguously-signed-bit-field.
This change reduces the number of false positives in the query.

View File

@@ -0,0 +1,13 @@
## 0.0.9
### New Queries
* Added a new query, `cpp/open-call-with-mode-argument`, to detect when `open` or `openat` is called with the `O_CREAT` or `O_TMPFILE` flag but when the `mode` argument is omitted.
### Minor Analysis Improvements
* The "Cleartext transmission of sensitive information" (`cpp/cleartext-transmission`) query has been further improved to reduce false positive results, and upgraded from `medium` to `high` precision.
* The "Cleartext transmission of sensitive information" (`cpp/cleartext-transmission`) query now finds more results, where a password is stored in a struct field or class member variable.
* The `cpp/cleartext-storage-file` query has been improved, removing false positives where data is written to a standard output stream.
* The `cpp/cleartext-storage-buffer` query has been updated to use the `semmle.code.cpp.dataflow.TaintTracking` library.
* The `cpp/world-writable-file-creation` query now only detects `open` and `openat` calls with the `O_CREAT` or `O_TMPFILE` flag.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.0.7
lastReleaseVersion: 0.0.10

View File

@@ -38,6 +38,8 @@ where
) and
eq.getRightOperand() instanceof Literal and
ne.getRightOperand() instanceof Literal and
eq.getLeftOperand().getFullyConverted().getUnspecifiedType() =
ne.getLeftOperand().getFullyConverted().getUnspecifiedType() and
nearestParent(eq) = nearestParent(ne) and
sameExpr(eq.getLeftOperand(), ne.getLeftOperand())
select ne, "Useless Test"

View File

@@ -2,59 +2,40 @@
import cpp
private string relativePath(File file) { result = file.getRelativePath().replaceAll("\\", "/") }
cached
private predicate tokenLocation(string path, int sl, int sc, int ec, int el, Copy copy, int index) {
path = copy.sourceFile().getAbsolutePath() and
tokens(copy, index, sl, sc, ec, el)
}
/** A token block used for detection of duplicate and similar code. */
class Copy extends @duplication_or_similarity {
/** Gets the index of the last token in this block. */
private int lastToken() { result = max(int i | tokens(this, i, _, _, _, _) | i) }
private newtype TDuplicationOrSimilarity = MKDuplicationOrSimilarity()
/**
* DEPRECATED: This class is no longer used.
*
* A token block used for detection of duplicate and similar code.
*/
class Copy extends TDuplicationOrSimilarity {
/** Gets the index of the token in this block starting at the location `loc`, if any. */
int tokenStartingAt(Location loc) {
exists(string filepath, int startline, int startcol |
loc.hasLocationInfo(filepath, startline, startcol, _, _) and
tokenLocation(filepath, startline, startcol, _, _, this, result)
)
}
int tokenStartingAt(Location loc) { none() }
/** Gets the index of the token in this block ending at the location `loc`, if any. */
int tokenEndingAt(Location loc) {
exists(string filepath, int endline, int endcol |
loc.hasLocationInfo(filepath, _, _, endline, endcol) and
tokenLocation(filepath, _, _, endline, endcol, this, result)
)
}
int tokenEndingAt(Location loc) { none() }
/** Gets the line on which the first token in this block starts. */
int sourceStartLine() { tokens(this, 0, result, _, _, _) }
int sourceStartLine() { none() }
/** Gets the column on which the first token in this block starts. */
int sourceStartColumn() { tokens(this, 0, _, result, _, _) }
int sourceStartColumn() { none() }
/** Gets the line on which the last token in this block ends. */
int sourceEndLine() { tokens(this, this.lastToken(), _, _, result, _) }
int sourceEndLine() { none() }
/** Gets the column on which the last token in this block ends. */
int sourceEndColumn() { tokens(this, this.lastToken(), _, _, _, result) }
int sourceEndColumn() { none() }
/** Gets the number of lines containing at least (part of) one token in this block. */
int sourceLines() { result = this.sourceEndLine() + 1 - this.sourceStartLine() }
/** Gets an opaque identifier for the equivalence class of this block. */
int getEquivalenceClass() { duplicateCode(this, _, result) or similarCode(this, _, result) }
int getEquivalenceClass() { none() }
/** Gets the source file in which this block appears. */
File sourceFile() {
exists(string name | duplicateCode(this, name, _) or similarCode(this, name, _) |
name.replaceAll("\\", "/") = relativePath(result)
)
}
File sourceFile() { none() }
/**
* Holds if this element is at the specified location.
@@ -77,15 +58,23 @@ class Copy extends @duplication_or_similarity {
string toString() { none() }
}
/** A block of duplicated code. */
class DuplicateBlock extends Copy, @duplication {
/**
* DEPRECATED: This class is no longer used.
*
* A block of duplicated code.
*/
class DuplicateBlock extends Copy {
override string toString() {
result = "Duplicate code: " + this.sourceLines() + " duplicated lines."
}
}
/** A block of similar code. */
class SimilarBlock extends Copy, @similarity {
/**
* DEPRECATED: This class is no longer used.
*
* A block of similar code.
*/
class SimilarBlock extends Copy {
override string toString() {
result = "Similar code: " + this.sourceLines() + " almost duplicated lines."
}

View File

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

View File

@@ -11390,6 +11390,872 @@ ir.cpp:
# 1458| Value = [Literal] 3
# 1458| ValueCategory = prvalue
# 1459| getStmt(1): [ReturnStmt] return ...
# 1462| [TopLevelFunction] void array_structured_binding()
# 1462| <params>:
# 1462| getEntryPoint(): [BlockStmt] { ... }
# 1463| getStmt(0): [DeclStmt] declaration
# 1463| getDeclarationEntry(0): [VariableDeclarationEntry] definition of xs
# 1463| Type = [ArrayType] int[2]
# 1463| getVariable().getInitializer(): [Initializer] initializer for xs
# 1463| getExpr(): [ArrayAggregateLiteral] {...}
# 1463| Type = [ArrayType] int[2]
# 1463| ValueCategory = prvalue
# 1463| getElementExpr(0): [Literal] 1
# 1463| Type = [IntType] int
# 1463| Value = [Literal] 1
# 1463| ValueCategory = prvalue
# 1463| getElementExpr(1): [Literal] 2
# 1463| Type = [IntType] int
# 1463| Value = [Literal] 2
# 1463| ValueCategory = prvalue
# 1465| getStmt(1): [BlockStmt] { ... }
# 1466| getStmt(0): [DeclStmt] declaration
# 1466| getDeclarationEntry(0): (no string representation)
# 1466| Type = [LValueReferenceType] int(&)[2]
# 1466| getVariable().getInitializer(): [Initializer] initializer for (unnamed local variable)
# 1466| getExpr(): [VariableAccess] xs
# 1466| Type = [ArrayType] int[2]
# 1466| ValueCategory = lvalue
# 1466| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1466| Type = [LValueReferenceType] int(&)[2]
# 1466| ValueCategory = prvalue
# 1466| getDeclarationEntry(1): [VariableDeclarationEntry] definition of x0
# 1466| Type = [IntType] int
#-----| getVariable().getInitializer(): [Initializer] initializer for x0
#-----| getExpr(): [ArrayExpr] access to array
#-----| Type = [IntType] int
#-----| ValueCategory = lvalue
#-----| getArrayBase(): [VariableAccess] (unnamed local variable)
#-----| Type = [LValueReferenceType] int(&)[2]
#-----| ValueCategory = prvalue(load)
#-----| getArrayOffset(): [Literal] 0
#-----| Type = [LongType] unsigned long
#-----| Value = [Literal] 0
#-----| ValueCategory = prvalue
#-----| getArrayBase().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
#-----| Type = [IntPointerType] int *
#-----| ValueCategory = prvalue
#-----| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
#-----| Type = [ArrayType] int[2]
#-----| ValueCategory = lvalue
# 1466| getDeclarationEntry(2): [VariableDeclarationEntry] definition of x1
# 1466| Type = [IntType] int
#-----| getVariable().getInitializer(): [Initializer] initializer for x1
#-----| getExpr(): [ArrayExpr] access to array
#-----| Type = [IntType] int
#-----| ValueCategory = lvalue
#-----| getArrayBase(): [VariableAccess] (unnamed local variable)
#-----| Type = [LValueReferenceType] int(&)[2]
#-----| ValueCategory = prvalue(load)
#-----| getArrayOffset(): [Literal] 1
#-----| Type = [LongType] unsigned long
#-----| Value = [Literal] 1
#-----| ValueCategory = prvalue
#-----| getArrayBase().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
#-----| Type = [IntPointerType] int *
#-----| ValueCategory = prvalue
#-----| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
#-----| Type = [ArrayType] int[2]
#-----| ValueCategory = lvalue
# 1467| getStmt(1): [ExprStmt] ExprStmt
# 1467| getExpr(): [AssignExpr] ... = ...
# 1467| Type = [IntType] int
# 1467| ValueCategory = lvalue
# 1467| getLValue(): [VariableAccess] x1
# 1467| Type = [IntType] int
# 1467| ValueCategory = lvalue
# 1467| getRValue(): [Literal] 3
# 1467| Type = [IntType] int
# 1467| Value = [Literal] 3
# 1467| ValueCategory = prvalue
# 1468| getStmt(2): [DeclStmt] declaration
# 1468| getDeclarationEntry(0): [VariableDeclarationEntry] definition of rx1
# 1468| Type = [LValueReferenceType] int &
# 1468| getVariable().getInitializer(): [Initializer] initializer for rx1
# 1468| getExpr(): [VariableAccess] x1
# 1468| Type = [IntType] int
# 1468| ValueCategory = lvalue
# 1468| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1468| Type = [LValueReferenceType] int &
# 1468| ValueCategory = prvalue
# 1469| getStmt(3): [DeclStmt] declaration
# 1469| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x
# 1469| Type = [IntType] int
# 1469| getVariable().getInitializer(): [Initializer] initializer for x
# 1469| getExpr(): [VariableAccess] x1
# 1469| Type = [IntType] int
# 1469| ValueCategory = prvalue(load)
# 1472| getStmt(2): [BlockStmt] { ... }
# 1473| getStmt(0): [DeclStmt] declaration
# 1473| getDeclarationEntry(0): [VariableDeclarationEntry] definition of unnamed_local_variable
# 1473| Type = [LValueReferenceType] int(&)[2]
# 1473| getVariable().getInitializer(): [Initializer] initializer for unnamed_local_variable
# 1473| getExpr(): [VariableAccess] xs
# 1473| Type = [ArrayType] int[2]
# 1473| ValueCategory = lvalue
# 1473| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1473| Type = [LValueReferenceType] int(&)[2]
# 1473| ValueCategory = prvalue
# 1474| getStmt(1): [DeclStmt] declaration
# 1474| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x0
# 1474| Type = [LValueReferenceType] int &
# 1474| getVariable().getInitializer(): [Initializer] initializer for x0
# 1474| getExpr(): [ArrayExpr] access to array
# 1474| Type = [IntType] int
# 1474| ValueCategory = lvalue
# 1474| getArrayBase(): [VariableAccess] xs
# 1474| Type = [ArrayType] int[2]
# 1474| ValueCategory = lvalue
# 1474| getArrayOffset(): [Literal] 0
# 1474| Type = [IntType] int
# 1474| Value = [Literal] 0
# 1474| ValueCategory = prvalue
# 1474| getArrayBase().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
# 1474| Type = [IntPointerType] int *
# 1474| ValueCategory = prvalue
# 1474| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1474| Type = [LValueReferenceType] int &
# 1474| ValueCategory = prvalue
# 1475| getStmt(2): [DeclStmt] declaration
# 1475| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x1
# 1475| Type = [LValueReferenceType] int &
# 1475| getVariable().getInitializer(): [Initializer] initializer for x1
# 1475| getExpr(): [ArrayExpr] access to array
# 1475| Type = [IntType] int
# 1475| ValueCategory = lvalue
# 1475| getArrayBase(): [VariableAccess] xs
# 1475| Type = [ArrayType] int[2]
# 1475| ValueCategory = lvalue
# 1475| getArrayOffset(): [Literal] 1
# 1475| Type = [IntType] int
# 1475| Value = [Literal] 1
# 1475| ValueCategory = prvalue
# 1475| getArrayBase().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
# 1475| Type = [IntPointerType] int *
# 1475| ValueCategory = prvalue
# 1475| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1475| Type = [LValueReferenceType] int &
# 1475| ValueCategory = prvalue
# 1476| getStmt(3): [ExprStmt] ExprStmt
# 1476| getExpr(): [AssignExpr] ... = ...
# 1476| Type = [IntType] int
# 1476| ValueCategory = lvalue
# 1476| getLValue(): [VariableAccess] x1
# 1476| Type = [LValueReferenceType] int &
# 1476| ValueCategory = prvalue(load)
# 1476| getRValue(): [Literal] 3
# 1476| Type = [IntType] int
# 1476| Value = [Literal] 3
# 1476| ValueCategory = prvalue
# 1476| getLValue().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1476| Type = [IntType] int
# 1476| ValueCategory = lvalue
# 1477| getStmt(4): [DeclStmt] declaration
# 1477| getDeclarationEntry(0): [VariableDeclarationEntry] definition of rx1
# 1477| Type = [LValueReferenceType] int &
# 1477| getVariable().getInitializer(): [Initializer] initializer for rx1
# 1477| getExpr(): [VariableAccess] x1
# 1477| Type = [LValueReferenceType] int &
# 1477| ValueCategory = prvalue(load)
# 1477| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1477| Type = [LValueReferenceType] int &
# 1477| ValueCategory = prvalue
# 1477| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1477| Type = [IntType] int
# 1477| ValueCategory = lvalue
# 1478| getStmt(5): [DeclStmt] declaration
# 1478| getDeclarationEntry(0): [VariableDeclarationEntry] definition of x
# 1478| Type = [IntType] int
# 1478| getVariable().getInitializer(): [Initializer] initializer for x
# 1478| getExpr(): [VariableAccess] x1
# 1478| Type = [LValueReferenceType] int &
# 1478| ValueCategory = prvalue(load)
# 1478| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1478| Type = [IntType] int
# 1478| ValueCategory = prvalue(load)
# 1480| getStmt(3): [ReturnStmt] return ...
# 1482| [CopyAssignmentOperator] StructuredBindingDataMemberStruct& StructuredBindingDataMemberStruct::operator=(StructuredBindingDataMemberStruct const&)
# 1482| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [LValueReferenceType] const StructuredBindingDataMemberStruct &
# 1482| [Constructor] void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct()
# 1482| <params>:
# 1482| <initializations>:
# 1482| getInitializer(0): [ConstructorFieldInit] constructor init of field i
# 1482| Type = [IntType] int
# 1482| ValueCategory = prvalue
# 1482| getInitializer(1): [ConstructorFieldInit] constructor init of field d
# 1482| Type = [DoubleType] double
# 1482| ValueCategory = prvalue
# 1482| getInitializer(2): [ConstructorFieldInit] constructor init of field r
# 1482| Type = [LValueReferenceType] int &
# 1482| ValueCategory = prvalue
# 1482| getEntryPoint(): [BlockStmt] { ... }
# 1482| getStmt(0): [ReturnStmt] return ...
# 1482| [CopyConstructor] void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct(StructuredBindingDataMemberStruct const&)
# 1482| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [LValueReferenceType] const StructuredBindingDataMemberStruct &
# 1482| <initializations>:
# 1482| getInitializer(0): [ConstructorFieldInit] constructor init of field i
# 1482| Type = [IntType] int
# 1482| ValueCategory = prvalue
# 1482| getExpr(): [Literal] Unknown literal
# 1482| Type = [IntType] int
# 1482| ValueCategory = prvalue
# 1482| getInitializer(1): [ConstructorFieldInit] constructor init of field d
# 1482| Type = [DoubleType] double
# 1482| ValueCategory = prvalue
# 1482| getExpr(): [Literal] Unknown literal
# 1482| Type = [DoubleType] double
# 1482| ValueCategory = prvalue
# 1482| getInitializer(2): [ConstructorFieldInit] constructor init of field b
# 1482| Type = [IntType] unsigned int
# 1482| ValueCategory = prvalue
# 1482| getExpr(): [Literal] Unknown literal
# 1482| Type = [IntType] unsigned int
# 1482| ValueCategory = prvalue
# 1482| getInitializer(3): [ConstructorFieldInit] constructor init of field r
# 1482| Type = [LValueReferenceType] int &
# 1482| ValueCategory = prvalue
# 1482| getExpr(): [Literal] Unknown literal
# 1482| Type = [LValueReferenceType] int &
# 1482| ValueCategory = prvalue
# 1482| getEntryPoint(): [BlockStmt] { ... }
# 1482| getStmt(0): [ReturnStmt] return ...
# 1482| [MoveConstructor] void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct(StructuredBindingDataMemberStruct&&)
# 1482| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [RValueReferenceType] StructuredBindingDataMemberStruct &&
# 1489| [TopLevelFunction] void data_member_structured_binding()
# 1489| <params>:
# 1489| getEntryPoint(): [BlockStmt] { ... }
# 1490| getStmt(0): [DeclStmt] declaration
# 1490| getDeclarationEntry(0): [VariableDeclarationEntry] definition of s
# 1490| Type = [Struct] StructuredBindingDataMemberStruct
# 1490| getVariable().getInitializer(): [Initializer] initializer for s
# 1490| getExpr(): [ConstructorCall] call to StructuredBindingDataMemberStruct
# 1490| Type = [VoidType] void
# 1490| ValueCategory = prvalue
# 1492| getStmt(1): [BlockStmt] { ... }
# 1493| getStmt(0): [DeclStmt] declaration
# 1493| getDeclarationEntry(0): (no string representation)
# 1493| Type = [Struct] StructuredBindingDataMemberStruct
# 1493| getVariable().getInitializer(): [Initializer] initializer for (unnamed local variable)
# 1493| getExpr(): [VariableAccess] s
# 1493| Type = [Struct] StructuredBindingDataMemberStruct
# 1493| ValueCategory = prvalue(load)
# 1493| getDeclarationEntry(1): [VariableDeclarationEntry] definition of i
# 1493| Type = [IntType] int
#-----| getVariable().getInitializer(): [Initializer] initializer for i
# 1493| getExpr(): [ValueFieldAccess] i
# 1493| Type = [IntType] int
# 1493| ValueCategory = lvalue
# 1493| getQualifier(): [VariableAccess] (unnamed local variable)
# 1493| Type = [Struct] StructuredBindingDataMemberStruct
# 1493| ValueCategory = lvalue
# 1493| getDeclarationEntry(2): [VariableDeclarationEntry] definition of d
# 1493| Type = [DoubleType] double
#-----| getVariable().getInitializer(): [Initializer] initializer for d
# 1493| getExpr(): [ValueFieldAccess] d
# 1493| Type = [DoubleType] double
# 1493| ValueCategory = lvalue
# 1493| getQualifier(): [VariableAccess] (unnamed local variable)
# 1493| Type = [Struct] StructuredBindingDataMemberStruct
# 1493| ValueCategory = lvalue
# 1493| getDeclarationEntry(3): [VariableDeclarationEntry] definition of b
# 1493| Type = [IntType] unsigned int
#-----| getVariable().getInitializer(): [Initializer] initializer for b
# 1493| getExpr(): [ValueFieldAccess] b
# 1493| Type = [IntType] unsigned int
# 1493| ValueCategory = lvalue
# 1493| getQualifier(): [VariableAccess] (unnamed local variable)
# 1493| Type = [Struct] StructuredBindingDataMemberStruct
# 1493| ValueCategory = lvalue
# 1493| getDeclarationEntry(4): [VariableDeclarationEntry] definition of r
# 1493| Type = [IntType] int
#-----| getVariable().getInitializer(): [Initializer] initializer for r
# 1493| getExpr(): [ValueFieldAccess] r
# 1493| Type = [LValueReferenceType] int &
# 1493| ValueCategory = prvalue(load)
# 1493| getQualifier(): [VariableAccess] (unnamed local variable)
# 1493| Type = [Struct] StructuredBindingDataMemberStruct
# 1493| ValueCategory = lvalue
# 1493| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1493| Type = [IntType] int
# 1493| ValueCategory = lvalue
# 1494| getStmt(1): [ExprStmt] ExprStmt
# 1494| getExpr(): [AssignExpr] ... = ...
# 1494| Type = [DoubleType] double
# 1494| ValueCategory = lvalue
# 1494| getLValue(): [VariableAccess] d
# 1494| Type = [DoubleType] double
# 1494| ValueCategory = lvalue
# 1494| getRValue(): [Literal] 4.0
# 1494| Type = [DoubleType] double
# 1494| Value = [Literal] 4.0
# 1494| ValueCategory = prvalue
# 1495| getStmt(2): [DeclStmt] declaration
# 1495| getDeclarationEntry(0): [VariableDeclarationEntry] definition of rd
# 1495| Type = [LValueReferenceType] double &
# 1495| getVariable().getInitializer(): [Initializer] initializer for rd
# 1495| getExpr(): [VariableAccess] d
# 1495| Type = [DoubleType] double
# 1495| ValueCategory = lvalue
# 1495| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1495| Type = [LValueReferenceType] double &
# 1495| ValueCategory = prvalue
# 1496| getStmt(3): [DeclStmt] declaration
# 1496| getDeclarationEntry(0): [VariableDeclarationEntry] definition of v
# 1496| Type = [IntType] int
# 1496| getVariable().getInitializer(): [Initializer] initializer for v
# 1496| getExpr(): [VariableAccess] i
# 1496| Type = [IntType] int
# 1496| ValueCategory = prvalue(load)
# 1497| getStmt(4): [ExprStmt] ExprStmt
# 1497| getExpr(): [AssignExpr] ... = ...
# 1497| Type = [IntType] int
# 1497| ValueCategory = lvalue
# 1497| getLValue(): [VariableAccess] r
# 1497| Type = [IntType] int
# 1497| ValueCategory = lvalue
# 1497| getRValue(): [Literal] 5
# 1497| Type = [IntType] int
# 1497| Value = [Literal] 5
# 1497| ValueCategory = prvalue
# 1498| getStmt(5): [DeclStmt] declaration
# 1498| getDeclarationEntry(0): [VariableDeclarationEntry] definition of rr
# 1498| Type = [LValueReferenceType] int &
# 1498| getVariable().getInitializer(): [Initializer] initializer for rr
# 1498| getExpr(): [VariableAccess] r
# 1498| Type = [IntType] int
# 1498| ValueCategory = lvalue
# 1498| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1498| Type = [LValueReferenceType] int &
# 1498| ValueCategory = prvalue
# 1499| getStmt(6): [DeclStmt] declaration
# 1499| getDeclarationEntry(0): [VariableDeclarationEntry] definition of w
# 1499| Type = [IntType] int
# 1499| getVariable().getInitializer(): [Initializer] initializer for w
# 1499| getExpr(): [VariableAccess] r
# 1499| Type = [IntType] int
# 1499| ValueCategory = prvalue(load)
# 1502| getStmt(2): [BlockStmt] { ... }
# 1503| getStmt(0): [DeclStmt] declaration
# 1503| getDeclarationEntry(0): [VariableDeclarationEntry] definition of unnamed_local_variable
# 1503| Type = [Struct] StructuredBindingDataMemberStruct
# 1503| getVariable().getInitializer(): [Initializer] initializer for unnamed_local_variable
# 1503| getExpr(): [VariableAccess] s
# 1503| Type = [Struct] StructuredBindingDataMemberStruct
# 1503| ValueCategory = prvalue(load)
# 1504| getStmt(1): [DeclStmt] declaration
# 1504| getDeclarationEntry(0): [VariableDeclarationEntry] definition of i
# 1504| Type = [LValueReferenceType] int &
# 1504| getVariable().getInitializer(): [Initializer] initializer for i
# 1504| getExpr(): [ValueFieldAccess] i
# 1504| Type = [IntType] int
# 1504| ValueCategory = lvalue
# 1504| getQualifier(): [VariableAccess] unnamed_local_variable
# 1504| Type = [Struct] StructuredBindingDataMemberStruct
# 1504| ValueCategory = lvalue
# 1504| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1504| Type = [LValueReferenceType] int &
# 1504| ValueCategory = prvalue
# 1505| getStmt(2): [DeclStmt] declaration
# 1505| getDeclarationEntry(0): [VariableDeclarationEntry] definition of d
# 1505| Type = [LValueReferenceType] double &
# 1505| getVariable().getInitializer(): [Initializer] initializer for d
# 1505| getExpr(): [ValueFieldAccess] d
# 1505| Type = [DoubleType] double
# 1505| ValueCategory = lvalue
# 1505| getQualifier(): [VariableAccess] unnamed_local_variable
# 1505| Type = [Struct] StructuredBindingDataMemberStruct
# 1505| ValueCategory = lvalue
# 1505| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1505| Type = [LValueReferenceType] double &
# 1505| ValueCategory = prvalue
# 1507| getStmt(3): [DeclStmt] declaration
# 1507| getDeclarationEntry(0): [VariableDeclarationEntry] definition of r
# 1507| Type = [LValueReferenceType] int &
# 1507| getVariable().getInitializer(): [Initializer] initializer for r
# 1507| getExpr(): [ValueFieldAccess] r
# 1507| Type = [LValueReferenceType] int &
# 1507| ValueCategory = prvalue(load)
# 1507| getQualifier(): [VariableAccess] unnamed_local_variable
# 1507| Type = [Struct] StructuredBindingDataMemberStruct
# 1507| ValueCategory = lvalue
# 1507| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1507| Type = [LValueReferenceType] int &
# 1507| ValueCategory = prvalue
# 1507| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1507| Type = [IntType] int
# 1507| ValueCategory = lvalue
# 1508| getStmt(4): [ExprStmt] ExprStmt
# 1508| getExpr(): [AssignExpr] ... = ...
# 1508| Type = [DoubleType] double
# 1508| ValueCategory = lvalue
# 1508| getLValue(): [VariableAccess] d
# 1508| Type = [LValueReferenceType] double &
# 1508| ValueCategory = prvalue(load)
# 1508| getRValue(): [Literal] 4.0
# 1508| Type = [DoubleType] double
# 1508| Value = [Literal] 4.0
# 1508| ValueCategory = prvalue
# 1508| getLValue().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1508| Type = [DoubleType] double
# 1508| ValueCategory = lvalue
# 1509| getStmt(5): [DeclStmt] declaration
# 1509| getDeclarationEntry(0): [VariableDeclarationEntry] definition of rd
# 1509| Type = [LValueReferenceType] double &
# 1509| getVariable().getInitializer(): [Initializer] initializer for rd
# 1509| getExpr(): [VariableAccess] d
# 1509| Type = [LValueReferenceType] double &
# 1509| ValueCategory = prvalue(load)
# 1509| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1509| Type = [LValueReferenceType] double &
# 1509| ValueCategory = prvalue
# 1509| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1509| Type = [DoubleType] double
# 1509| ValueCategory = lvalue
# 1510| getStmt(6): [DeclStmt] declaration
# 1510| getDeclarationEntry(0): [VariableDeclarationEntry] definition of v
# 1510| Type = [IntType] int
# 1510| getVariable().getInitializer(): [Initializer] initializer for v
# 1510| getExpr(): [VariableAccess] i
# 1510| Type = [LValueReferenceType] int &
# 1510| ValueCategory = prvalue(load)
# 1510| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1510| Type = [IntType] int
# 1510| ValueCategory = prvalue(load)
# 1511| getStmt(7): [ExprStmt] ExprStmt
# 1511| getExpr(): [AssignExpr] ... = ...
# 1511| Type = [IntType] int
# 1511| ValueCategory = lvalue
# 1511| getLValue(): [VariableAccess] r
# 1511| Type = [LValueReferenceType] int &
# 1511| ValueCategory = prvalue(load)
# 1511| getRValue(): [Literal] 5
# 1511| Type = [IntType] int
# 1511| Value = [Literal] 5
# 1511| ValueCategory = prvalue
# 1511| getLValue().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1511| Type = [IntType] int
# 1511| ValueCategory = lvalue
# 1512| getStmt(8): [DeclStmt] declaration
# 1512| getDeclarationEntry(0): [VariableDeclarationEntry] definition of rr
# 1512| Type = [LValueReferenceType] int &
# 1512| getVariable().getInitializer(): [Initializer] initializer for rr
# 1512| getExpr(): [VariableAccess] r
# 1512| Type = [LValueReferenceType] int &
# 1512| ValueCategory = prvalue(load)
# 1512| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1512| Type = [LValueReferenceType] int &
# 1512| ValueCategory = prvalue
# 1512| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1512| Type = [IntType] int
# 1512| ValueCategory = lvalue
# 1513| getStmt(9): [DeclStmt] declaration
# 1513| getDeclarationEntry(0): [VariableDeclarationEntry] definition of w
# 1513| Type = [IntType] int
# 1513| getVariable().getInitializer(): [Initializer] initializer for w
# 1513| getExpr(): [VariableAccess] r
# 1513| Type = [LValueReferenceType] int &
# 1513| ValueCategory = prvalue(load)
# 1513| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1513| Type = [IntType] int
# 1513| ValueCategory = prvalue(load)
# 1515| getStmt(3): [ReturnStmt] return ...
# 1522| [CopyAssignmentOperator] std::tuple_size<StructuredBindingTuple>& std::tuple_size<StructuredBindingTuple>::operator=(std::tuple_size<StructuredBindingTuple> const&)
# 1522| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [LValueReferenceType] const tuple_size<StructuredBindingTuple> &
# 1522| [MoveAssignmentOperator] std::tuple_size<StructuredBindingTuple>& std::tuple_size<StructuredBindingTuple>::operator=(std::tuple_size<StructuredBindingTuple>&&)
# 1522| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [RValueReferenceType] tuple_size<StructuredBindingTuple> &&
# 1529| [CopyAssignmentOperator] std::tuple_element<int 0, StructuredBindingTuple>& std::tuple_element<int 0, StructuredBindingTuple>::operator=(std::tuple_element<int 0, StructuredBindingTuple> const&)
# 1529| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [LValueReferenceType] const tuple_element<0, StructuredBindingTuple> &
# 1529| [MoveAssignmentOperator] std::tuple_element<int 0, StructuredBindingTuple>& std::tuple_element<int 0, StructuredBindingTuple>::operator=(std::tuple_element<int 0, StructuredBindingTuple>&&)
# 1529| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [RValueReferenceType] tuple_element<0, StructuredBindingTuple> &&
# 1533| [CopyAssignmentOperator] std::tuple_element<int 1, StructuredBindingTuple>& std::tuple_element<int 1, StructuredBindingTuple>::operator=(std::tuple_element<int 1, StructuredBindingTuple> const&)
# 1533| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [LValueReferenceType] const tuple_element<1, StructuredBindingTuple> &
# 1533| [MoveAssignmentOperator] std::tuple_element<int 1, StructuredBindingTuple>& std::tuple_element<int 1, StructuredBindingTuple>::operator=(std::tuple_element<int 1, StructuredBindingTuple>&&)
# 1533| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [RValueReferenceType] tuple_element<1, StructuredBindingTuple> &&
# 1537| [CopyAssignmentOperator] std::tuple_element<int 2, StructuredBindingTuple>& std::tuple_element<int 2, StructuredBindingTuple>::operator=(std::tuple_element<int 2, StructuredBindingTuple> const&)
# 1537| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [LValueReferenceType] const tuple_element<2, StructuredBindingTuple> &
# 1537| [MoveAssignmentOperator] std::tuple_element<int 2, StructuredBindingTuple>& std::tuple_element<int 2, StructuredBindingTuple>::operator=(std::tuple_element<int 2, StructuredBindingTuple>&&)
# 1537| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [RValueReferenceType] tuple_element<2, StructuredBindingTuple> &&
# 1542| [CopyAssignmentOperator] StructuredBindingTuple& StructuredBindingTuple::operator=(StructuredBindingTuple const&)
# 1542| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [LValueReferenceType] const StructuredBindingTuple &
# 1542| [Constructor] void StructuredBindingTuple::StructuredBindingTuple()
# 1542| <params>:
# 1542| <initializations>:
# 1542| getInitializer(0): [ConstructorFieldInit] constructor init of field i
# 1542| Type = [IntType] int
# 1542| ValueCategory = prvalue
# 1542| getInitializer(1): [ConstructorFieldInit] constructor init of field d
# 1542| Type = [DoubleType] double
# 1542| ValueCategory = prvalue
# 1542| getInitializer(2): [ConstructorFieldInit] constructor init of field r
# 1542| Type = [LValueReferenceType] int &
# 1542| ValueCategory = prvalue
# 1542| getEntryPoint(): [BlockStmt] { ... }
# 1542| getStmt(0): [ReturnStmt] return ...
# 1542| [CopyConstructor] void StructuredBindingTuple::StructuredBindingTuple(StructuredBindingTuple const&)
# 1542| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [LValueReferenceType] const StructuredBindingTuple &
# 1542| <initializations>:
# 1542| getInitializer(0): [ConstructorFieldInit] constructor init of field i
# 1542| Type = [IntType] int
# 1542| ValueCategory = prvalue
# 1542| getExpr(): [Literal] Unknown literal
# 1542| Type = [IntType] int
# 1542| ValueCategory = prvalue
# 1542| getInitializer(1): [ConstructorFieldInit] constructor init of field d
# 1542| Type = [DoubleType] double
# 1542| ValueCategory = prvalue
# 1542| getExpr(): [Literal] Unknown literal
# 1542| Type = [DoubleType] double
# 1542| ValueCategory = prvalue
# 1542| getInitializer(2): [ConstructorFieldInit] constructor init of field r
# 1542| Type = [LValueReferenceType] int &
# 1542| ValueCategory = prvalue
# 1542| getExpr(): [Literal] Unknown literal
# 1542| Type = [LValueReferenceType] int &
# 1542| ValueCategory = prvalue
# 1542| getEntryPoint(): [BlockStmt] { ... }
# 1542| getStmt(0): [ReturnStmt] return ...
# 1542| [MoveConstructor] void StructuredBindingTuple::StructuredBindingTuple(StructuredBindingTuple&&)
# 1542| <params>:
#-----| getParameter(0): [Parameter] (unnamed parameter 0)
#-----| Type = [RValueReferenceType] StructuredBindingTuple &&
# 1548| [MemberFunction,TemplateFunction] type& StructuredBindingTuple::get<int i>()
# 1548| <params>:
# 1552| [FunctionTemplateSpecialization,MemberFunction] std::tuple_element<int 0, StructuredBindingTuple>::type& StructuredBindingTuple::get<int 0>()
# 1552| <params>:
# 1552| getEntryPoint(): [BlockStmt] { ... }
# 1552| getStmt(0): [ReturnStmt] return ...
# 1552| getExpr(): [PointerFieldAccess] i
# 1552| Type = [IntType] int
# 1552| ValueCategory = lvalue
# 1552| getQualifier(): [ThisExpr] this
# 1552| Type = [PointerType] StructuredBindingTuple *
# 1552| ValueCategory = prvalue(load)
#-----| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
#-----| Type = [LValueReferenceType] int &
#-----| ValueCategory = prvalue
# 1554| [FunctionTemplateSpecialization,MemberFunction] std::tuple_element<int 1, StructuredBindingTuple>::type& StructuredBindingTuple::get<int 1>()
# 1554| <params>:
# 1554| getEntryPoint(): [BlockStmt] { ... }
# 1554| getStmt(0): [ReturnStmt] return ...
# 1554| getExpr(): [PointerFieldAccess] d
# 1554| Type = [DoubleType] double
# 1554| ValueCategory = lvalue
# 1554| getQualifier(): [ThisExpr] this
# 1554| Type = [PointerType] StructuredBindingTuple *
# 1554| ValueCategory = prvalue(load)
#-----| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
#-----| Type = [LValueReferenceType] double &
#-----| ValueCategory = prvalue
# 1556| [FunctionTemplateSpecialization,MemberFunction] std::tuple_element<int 2, StructuredBindingTuple>::type StructuredBindingTuple::get<int 2>()
# 1556| <params>:
# 1556| getEntryPoint(): [BlockStmt] { ... }
# 1556| getStmt(0): [ReturnStmt] return ...
# 1556| getExpr(): [PointerFieldAccess] r
# 1556| Type = [LValueReferenceType] int &
# 1556| ValueCategory = prvalue(load)
# 1556| getQualifier(): [ThisExpr] this
# 1556| Type = [PointerType] StructuredBindingTuple *
# 1556| ValueCategory = prvalue(load)
# 1556| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1556| Type = [LValueReferenceType] int &
# 1556| ValueCategory = prvalue
# 1556| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1556| Type = [IntType] int
# 1556| ValueCategory = lvalue
# 1558| [TopLevelFunction] void tuple_structured_binding()
# 1558| <params>:
# 1558| getEntryPoint(): [BlockStmt] { ... }
# 1559| getStmt(0): [DeclStmt] declaration
# 1559| getDeclarationEntry(0): [VariableDeclarationEntry] definition of t
# 1559| Type = [Struct] StructuredBindingTuple
# 1559| getVariable().getInitializer(): [Initializer] initializer for t
# 1559| getExpr(): [ConstructorCall] call to StructuredBindingTuple
# 1559| Type = [VoidType] void
# 1559| ValueCategory = prvalue
# 1561| getStmt(1): [BlockStmt] { ... }
# 1562| getStmt(0): [DeclStmt] declaration
# 1562| getDeclarationEntry(0): (no string representation)
# 1562| Type = [Struct] StructuredBindingTuple
# 1562| getVariable().getInitializer(): [Initializer] initializer for (unnamed local variable)
# 1562| getExpr(): [VariableAccess] t
# 1562| Type = [Struct] StructuredBindingTuple
# 1562| ValueCategory = prvalue(load)
# 1562| getDeclarationEntry(1): [VariableDeclarationEntry] definition of i
# 1562| Type = [LValueReferenceType] type &
#-----| getVariable().getInitializer(): [Initializer] initializer for i
# 1562| getExpr(): [FunctionCall] call to get
# 1562| Type = [LValueReferenceType] type &
# 1562| ValueCategory = prvalue
# 1562| getQualifier(): [VariableAccess] (unnamed local variable)
# 1562| Type = [Struct] StructuredBindingTuple
# 1562| ValueCategory = xvalue
# 1562| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1562| Type = [LValueReferenceType] type &
# 1562| ValueCategory = prvalue
# 1562| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1562| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1562| ValueCategory = lvalue
# 1562| getDeclarationEntry(2): [VariableDeclarationEntry] definition of d
# 1562| Type = [LValueReferenceType] type &
#-----| getVariable().getInitializer(): [Initializer] initializer for d
# 1562| getExpr(): [FunctionCall] call to get
# 1562| Type = [LValueReferenceType] type &
# 1562| ValueCategory = prvalue
# 1562| getQualifier(): [VariableAccess] (unnamed local variable)
# 1562| Type = [Struct] StructuredBindingTuple
# 1562| ValueCategory = xvalue
# 1562| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1562| Type = [LValueReferenceType] type &
# 1562| ValueCategory = prvalue
# 1562| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1562| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1562| ValueCategory = lvalue
# 1562| getDeclarationEntry(3): [VariableDeclarationEntry] definition of r
# 1562| Type = [NestedTypedefType,UsingAliasTypedefType] type
#-----| getVariable().getInitializer(): [Initializer] initializer for r
# 1562| getExpr(): [FunctionCall] call to get
# 1562| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1562| ValueCategory = prvalue
# 1562| getQualifier(): [VariableAccess] (unnamed local variable)
# 1562| Type = [Struct] StructuredBindingTuple
# 1562| ValueCategory = xvalue
# 1562| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1562| Type = [LValueReferenceType] int &
# 1562| ValueCategory = prvalue
# 1562| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1562| Type = [IntType] int
# 1562| ValueCategory = lvalue
# 1563| getStmt(1): [ExprStmt] ExprStmt
# 1563| getExpr(): [AssignExpr] ... = ...
# 1563| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1563| ValueCategory = lvalue
# 1563| getLValue(): [VariableAccess] d
# 1563| Type = [LValueReferenceType] type &
# 1563| ValueCategory = prvalue(load)
# 1563| getRValue(): [Literal] 4.0
# 1563| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1563| Value = [Literal] 4.0
# 1563| ValueCategory = prvalue
# 1563| getLValue().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1563| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1563| ValueCategory = lvalue
# 1564| getStmt(2): [DeclStmt] declaration
# 1564| getDeclarationEntry(0): [VariableDeclarationEntry] definition of rd
# 1564| Type = [LValueReferenceType] double &
# 1564| getVariable().getInitializer(): [Initializer] initializer for rd
# 1564| getExpr(): [VariableAccess] d
# 1564| Type = [LValueReferenceType] type &
# 1564| ValueCategory = prvalue(load)
# 1564| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1564| Type = [LValueReferenceType] type &
# 1564| ValueCategory = prvalue
# 1564| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1564| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1564| ValueCategory = lvalue
# 1565| getStmt(3): [DeclStmt] declaration
# 1565| getDeclarationEntry(0): [VariableDeclarationEntry] definition of v
# 1565| Type = [IntType] int
# 1565| getVariable().getInitializer(): [Initializer] initializer for v
# 1565| getExpr(): [VariableAccess] i
# 1565| Type = [LValueReferenceType] type &
# 1565| ValueCategory = prvalue(load)
# 1565| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1565| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1565| ValueCategory = prvalue(load)
# 1566| getStmt(4): [ExprStmt] ExprStmt
# 1566| getExpr(): [AssignExpr] ... = ...
# 1566| Type = [IntType] int
# 1566| ValueCategory = lvalue
# 1566| getLValue(): [VariableAccess] r
# 1566| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1566| ValueCategory = prvalue(load)
# 1566| getRValue(): [Literal] 5
# 1566| Type = [IntType] int
# 1566| Value = [Literal] 5
# 1566| ValueCategory = prvalue
# 1566| getLValue().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1566| Type = [IntType] int
# 1566| ValueCategory = lvalue
# 1567| getStmt(5): [DeclStmt] declaration
# 1567| getDeclarationEntry(0): [VariableDeclarationEntry] definition of rr
# 1567| Type = [LValueReferenceType] int &
# 1567| getVariable().getInitializer(): [Initializer] initializer for rr
# 1567| getExpr(): [VariableAccess] r
# 1567| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1567| ValueCategory = prvalue(load)
# 1567| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1567| Type = [LValueReferenceType] int &
# 1567| ValueCategory = prvalue
# 1567| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1567| Type = [IntType] int
# 1567| ValueCategory = lvalue
# 1568| getStmt(6): [DeclStmt] declaration
# 1568| getDeclarationEntry(0): [VariableDeclarationEntry] definition of w
# 1568| Type = [IntType] int
# 1568| getVariable().getInitializer(): [Initializer] initializer for w
# 1568| getExpr(): [VariableAccess] r
# 1568| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1568| ValueCategory = prvalue(load)
# 1568| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1568| Type = [IntType] int
# 1568| ValueCategory = prvalue(load)
# 1571| getStmt(2): [BlockStmt] { ... }
# 1572| getStmt(0): [DeclStmt] declaration
# 1572| getDeclarationEntry(0): [VariableDeclarationEntry] definition of unnamed_local_variable
# 1572| Type = [Struct] StructuredBindingTuple
# 1572| getVariable().getInitializer(): [Initializer] initializer for unnamed_local_variable
# 1572| getExpr(): [VariableAccess] t
# 1572| Type = [Struct] StructuredBindingTuple
# 1572| ValueCategory = prvalue(load)
# 1573| getStmt(1): [DeclStmt] declaration
# 1573| getDeclarationEntry(0): [VariableDeclarationEntry] definition of i
# 1573| Type = [LValueReferenceType] type &
# 1573| getVariable().getInitializer(): [Initializer] initializer for i
# 1573| getExpr(): [FunctionCall] call to get
# 1573| Type = [LValueReferenceType] type &
# 1573| ValueCategory = prvalue
# 1573| getQualifier(): [VariableAccess] unnamed_local_variable
# 1573| Type = [Struct] StructuredBindingTuple
# 1573| ValueCategory = lvalue
# 1573| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1573| Type = [LValueReferenceType] type &
# 1573| ValueCategory = prvalue
# 1573| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1573| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1573| ValueCategory = lvalue
# 1574| getStmt(2): [DeclStmt] declaration
# 1574| getDeclarationEntry(0): [VariableDeclarationEntry] definition of d
# 1574| Type = [LValueReferenceType] type &
# 1574| getVariable().getInitializer(): [Initializer] initializer for d
# 1574| getExpr(): [FunctionCall] call to get
# 1574| Type = [LValueReferenceType] type &
# 1574| ValueCategory = prvalue
# 1574| getQualifier(): [VariableAccess] unnamed_local_variable
# 1574| Type = [Struct] StructuredBindingTuple
# 1574| ValueCategory = lvalue
# 1574| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1574| Type = [LValueReferenceType] type &
# 1574| ValueCategory = prvalue
# 1574| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1574| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1574| ValueCategory = lvalue
# 1575| getStmt(3): [DeclStmt] declaration
# 1575| getDeclarationEntry(0): [VariableDeclarationEntry] definition of r
# 1575| Type = [LValueReferenceType] int &
# 1575| getVariable().getInitializer(): [Initializer] initializer for r
# 1575| getExpr(): [FunctionCall] call to get
# 1575| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1575| ValueCategory = prvalue
# 1575| getQualifier(): [VariableAccess] unnamed_local_variable
# 1575| Type = [Struct] StructuredBindingTuple
# 1575| ValueCategory = lvalue
# 1575| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1575| Type = [LValueReferenceType] int &
# 1575| ValueCategory = prvalue
# 1575| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1575| Type = [IntType] int
# 1575| ValueCategory = lvalue
# 1576| getStmt(4): [ExprStmt] ExprStmt
# 1576| getExpr(): [AssignExpr] ... = ...
# 1576| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1576| ValueCategory = lvalue
# 1576| getLValue(): [VariableAccess] d
# 1576| Type = [LValueReferenceType] type &
# 1576| ValueCategory = prvalue(load)
# 1576| getRValue(): [Literal] 4.0
# 1576| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1576| Value = [Literal] 4.0
# 1576| ValueCategory = prvalue
# 1576| getLValue().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1576| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1576| ValueCategory = lvalue
# 1577| getStmt(5): [DeclStmt] declaration
# 1577| getDeclarationEntry(0): [VariableDeclarationEntry] definition of rd
# 1577| Type = [LValueReferenceType] double &
# 1577| getVariable().getInitializer(): [Initializer] initializer for rd
# 1577| getExpr(): [VariableAccess] d
# 1577| Type = [LValueReferenceType] type &
# 1577| ValueCategory = prvalue(load)
# 1577| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1577| Type = [LValueReferenceType] type &
# 1577| ValueCategory = prvalue
# 1577| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1577| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1577| ValueCategory = lvalue
# 1578| getStmt(6): [DeclStmt] declaration
# 1578| getDeclarationEntry(0): [VariableDeclarationEntry] definition of v
# 1578| Type = [IntType] int
# 1578| getVariable().getInitializer(): [Initializer] initializer for v
# 1578| getExpr(): [VariableAccess] i
# 1578| Type = [LValueReferenceType] type &
# 1578| ValueCategory = prvalue(load)
# 1578| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1578| Type = [NestedTypedefType,UsingAliasTypedefType] type
# 1578| ValueCategory = prvalue(load)
# 1579| getStmt(7): [ExprStmt] ExprStmt
# 1579| getExpr(): [AssignExpr] ... = ...
# 1579| Type = [IntType] int
# 1579| ValueCategory = lvalue
# 1579| getLValue(): [VariableAccess] r
# 1579| Type = [LValueReferenceType] int &
# 1579| ValueCategory = prvalue(load)
# 1579| getRValue(): [Literal] 5
# 1579| Type = [IntType] int
# 1579| Value = [Literal] 5
# 1579| ValueCategory = prvalue
# 1579| getLValue().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1579| Type = [IntType] int
# 1579| ValueCategory = lvalue
# 1580| getStmt(8): [DeclStmt] declaration
# 1580| getDeclarationEntry(0): [VariableDeclarationEntry] definition of rr
# 1580| Type = [LValueReferenceType] int &
# 1580| getVariable().getInitializer(): [Initializer] initializer for rr
# 1580| getExpr(): [VariableAccess] r
# 1580| Type = [LValueReferenceType] int &
# 1580| ValueCategory = prvalue(load)
# 1580| getExpr().getFullyConverted(): [ReferenceToExpr] (reference to)
# 1580| Type = [LValueReferenceType] int &
# 1580| ValueCategory = prvalue
# 1580| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
# 1580| Type = [IntType] int
# 1580| ValueCategory = lvalue
# 1581| getStmt(9): [DeclStmt] declaration
# 1581| getDeclarationEntry(0): [VariableDeclarationEntry] definition of w
# 1581| Type = [IntType] int
# 1581| getVariable().getInitializer(): [Initializer] initializer for w
# 1581| getExpr(): [VariableAccess] r
# 1581| Type = [LValueReferenceType] int &
# 1581| ValueCategory = prvalue(load)
# 1581| getExpr().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
# 1581| Type = [IntType] int
# 1581| ValueCategory = prvalue(load)
# 1583| getStmt(3): [ReturnStmt] return ...
perf-regression.cpp:
# 4| [CopyAssignmentOperator] Big& Big::operator=(Big const&)
# 4| <params>:

View File

@@ -1458,4 +1458,128 @@ struct Inheritance_Test_A : public Inheritance_Test_B {
y = 3;
}
};
void array_structured_binding() {
int xs[2] = {1, 2};
// structured binding use
{
auto& [x0, x1] = xs;
x1 = 3;
int &rx1 = x1;
int x = x1;
}
// explicit reference version
{
auto& unnamed_local_variable = xs;
auto& x0 = xs[0];
auto& x1 = xs[1];
x1 = 3;
int &rx1 = x1;
int x = x1;
}
}
struct StructuredBindingDataMemberStruct {
int i = 1;
double d = 2.0;
unsigned int b : 3;
int& r = i;
};
void data_member_structured_binding() {
StructuredBindingDataMemberStruct s;
// structured binding use
{
auto [i, d, b, r] = s;
d = 4.0;
double& rd = d;
int v = i;
r = 5;
int& rr = r;
int w = r;
}
// explicit reference version
{
auto unnamed_local_variable = s;
auto& i = unnamed_local_variable.i;
auto& d = unnamed_local_variable.d;
// no equivalent for b
auto& r = unnamed_local_variable.r;
d = 4.0;
double& rd = d;
int v = i;
r = 5;
int& rr = r;
int w = r;
}
}
struct StructuredBindingTuple;
namespace std {
template<typename T>
struct tuple_size;
template<>
struct tuple_size<StructuredBindingTuple> {
static const unsigned int value = 3;
};
template<int, typename T>
struct tuple_element;
template<>
struct tuple_element<0, StructuredBindingTuple> {
using type = int;
};
template<>
struct tuple_element<1, StructuredBindingTuple> {
using type = double;
};
template<>
struct tuple_element<2, StructuredBindingTuple> {
using type = int&;
};
}
struct StructuredBindingTuple {
int i = 1;
double d = 2.2;
int& r = i;
template<int i>
typename std::tuple_element<i, StructuredBindingTuple>::type& get();
};
template<>
std::tuple_element<0, StructuredBindingTuple>::type& StructuredBindingTuple::get<0>() { return i; }
template<>
std::tuple_element<1, StructuredBindingTuple>::type& StructuredBindingTuple::get<1>() { return d; }
template<>
std::tuple_element<2, StructuredBindingTuple>::type& StructuredBindingTuple::get<2>() { return r; }
void tuple_structured_binding() {
StructuredBindingTuple t;
// structured binding use
{
auto [i, d, r] = t;
d = 4.0;
double& rd = d;
int v = i;
r = 5;
int& rr = r;
int w = r;
}
// explicit reference version
{
auto unnamed_local_variable = t;
auto& i = unnamed_local_variable.get<0>();
auto& d = unnamed_local_variable.get<1>();
auto& r = unnamed_local_variable.get<2>();
d = 4.0;
double& rd = d;
int v = i;
r = 5;
int& rr = r;
int w = r;
}
}
// semmle-extractor-options: -std=c++17 --clang

View File

@@ -632,6 +632,7 @@
| 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 |
@@ -653,6 +654,7 @@
| file://:0:0:0:0 | Address | &:r0_8 |
| file://:0:0:0:0 | Address | &:r0_8 |
| file://:0:0:0:0 | Address | &:r0_8 |
| file://:0:0:0:0 | Address | &:r0_8 |
| file://:0:0:0:0 | Address | &:r0_9 |
| file://:0:0:0:0 | Address | &:r0_9 |
| file://:0:0:0:0 | Address | &:r0_10 |
@@ -682,6 +684,8 @@
| file://:0:0:0:0 | ChiTotal | total:m763_8 |
| file://:0:0:0:0 | ChiTotal | total:m1043_10 |
| file://:0:0:0:0 | ChiTotal | total:m1240_4 |
| file://:0:0:0:0 | Left | r0_4 |
| file://:0:0:0:0 | Left | r0_11 |
| file://:0:0:0:0 | Load | m0_2 |
| file://:0:0:0:0 | Load | m0_2 |
| file://:0:0:0:0 | Load | m0_2 |
@@ -689,7 +693,11 @@
| file://:0:0:0:0 | Load | m745_6 |
| file://:0:0:0:0 | Load | m754_6 |
| file://:0:0:0:0 | Load | m763_6 |
| file://:0:0:0:0 | Load | m1466_4 |
| file://:0:0:0:0 | Load | m1466_4 |
| file://:0:0:0:0 | Load | ~m1444_6 |
| file://:0:0:0:0 | Right | r0_5 |
| file://:0:0:0:0 | Right | r0_12 |
| file://:0:0:0:0 | SideEffect | m0_4 |
| file://:0:0:0:0 | SideEffect | m0_4 |
| file://:0:0:0:0 | SideEffect | m0_4 |
@@ -715,11 +723,17 @@
| file://:0:0:0:0 | StoreValue | r0_1 |
| file://:0:0:0:0 | StoreValue | r0_1 |
| file://:0:0:0:0 | StoreValue | r0_1 |
| file://:0:0:0:0 | StoreValue | r0_1 |
| file://:0:0:0:0 | StoreValue | r0_1 |
| file://:0:0:0:0 | StoreValue | r0_3 |
| file://:0:0:0:0 | StoreValue | r0_6 |
| file://:0:0:0:0 | StoreValue | r0_13 |
| file://:0:0:0:0 | StoreValue | r0_13 |
| file://:0:0:0:0 | StoreValue | r0_22 |
| file://:0:0:0:0 | StoreValue | r0_22 |
| file://:0:0:0:0 | Unary | r0_1 |
| file://:0:0:0:0 | Unary | r0_2 |
| file://:0:0:0:0 | Unary | r0_3 |
| file://:0:0:0:0 | Unary | r0_5 |
| file://:0:0:0:0 | Unary | r0_5 |
| file://:0:0:0:0 | Unary | r0_6 |
@@ -730,6 +744,8 @@
| file://:0:0:0:0 | Unary | r0_7 |
| file://:0:0:0:0 | Unary | r0_8 |
| file://:0:0:0:0 | Unary | r0_9 |
| file://:0:0:0:0 | Unary | r0_9 |
| file://:0:0:0:0 | Unary | r0_10 |
| file://:0:0:0:0 | Unary | r0_10 |
| file://:0:0:0:0 | Unary | r0_11 |
| file://:0:0:0:0 | Unary | r0_12 |
@@ -6656,6 +6672,426 @@
| ir.cpp:1458:5:1458:9 | ChiPartial | partial:m1458_5 |
| ir.cpp:1458:5:1458:9 | ChiTotal | total:m1457_12 |
| ir.cpp:1458:9:1458:9 | StoreValue | r1458_1 |
| ir.cpp:1462:6:1462:29 | ChiPartial | partial:m1462_3 |
| ir.cpp:1462:6:1462:29 | ChiTotal | total:m1462_2 |
| ir.cpp:1462:6:1462:29 | SideEffect | m1462_3 |
| ir.cpp:1463:9:1463:10 | Address | &:r1463_1 |
| ir.cpp:1463:9:1463:10 | Left | r1463_1 |
| ir.cpp:1463:9:1463:10 | Left | r1463_1 |
| ir.cpp:1463:16:1463:22 | Address | &:r1463_4 |
| ir.cpp:1463:16:1463:22 | Address | &:r1463_9 |
| ir.cpp:1463:16:1463:22 | Right | r1463_3 |
| ir.cpp:1463:16:1463:22 | Right | r1463_8 |
| ir.cpp:1463:18:1463:18 | ChiPartial | partial:m1463_6 |
| ir.cpp:1463:18:1463:18 | ChiTotal | total:m1463_2 |
| ir.cpp:1463:18:1463:18 | StoreValue | r1463_5 |
| ir.cpp:1463:21:1463:21 | ChiPartial | partial:m1463_11 |
| ir.cpp:1463:21:1463:21 | ChiTotal | total:m1463_7 |
| ir.cpp:1463:21:1463:21 | StoreValue | r1463_10 |
| ir.cpp:1466:15:1466:15 | Address | &:r1466_1 |
| ir.cpp:1466:16:1466:16 | Address | &:r1466_5 |
| ir.cpp:1466:20:1466:20 | Address | &:r1466_6 |
| ir.cpp:1466:26:1466:27 | StoreValue | r1466_3 |
| ir.cpp:1466:26:1466:27 | Unary | r1466_2 |
| ir.cpp:1467:9:1467:10 | Address | &:r1467_2 |
| ir.cpp:1467:14:1467:14 | StoreValue | r1467_1 |
| ir.cpp:1468:14:1468:16 | Address | &:r1468_1 |
| ir.cpp:1468:20:1468:21 | StoreValue | r1468_3 |
| ir.cpp:1468:20:1468:21 | Unary | r1468_2 |
| ir.cpp:1469:13:1469:13 | Address | &:r1469_1 |
| ir.cpp:1469:17:1469:18 | Address | &:r1469_2 |
| ir.cpp:1469:17:1469:18 | Load | m1467_3 |
| ir.cpp:1469:17:1469:18 | StoreValue | r1469_3 |
| ir.cpp:1473:15:1473:36 | Address | &:r1473_1 |
| ir.cpp:1473:40:1473:41 | StoreValue | r1473_3 |
| ir.cpp:1473:40:1473:41 | Unary | r1473_2 |
| ir.cpp:1474:15:1474:16 | Address | &:r1474_1 |
| ir.cpp:1474:20:1474:21 | Left | r1474_3 |
| ir.cpp:1474:20:1474:21 | Unary | r1474_2 |
| ir.cpp:1474:20:1474:24 | StoreValue | r1474_6 |
| ir.cpp:1474:20:1474:24 | Unary | r1474_5 |
| ir.cpp:1474:23:1474:23 | Right | r1474_4 |
| ir.cpp:1475:15:1475:16 | Address | &:r1475_1 |
| ir.cpp:1475:20:1475:21 | Left | r1475_3 |
| ir.cpp:1475:20:1475:21 | Unary | r1475_2 |
| ir.cpp:1475:20:1475:24 | StoreValue | r1475_6 |
| ir.cpp:1475:20:1475:24 | Unary | r1475_5 |
| ir.cpp:1475:23:1475:23 | Right | r1475_4 |
| ir.cpp:1476:9:1476:10 | Address | &:r1476_2 |
| ir.cpp:1476:9:1476:10 | Address | &:r1476_4 |
| ir.cpp:1476:9:1476:10 | Load | m1475_7 |
| ir.cpp:1476:9:1476:10 | Unary | r1476_3 |
| ir.cpp:1476:9:1476:14 | ChiPartial | partial:m1476_5 |
| ir.cpp:1476:9:1476:14 | ChiTotal | total:m1463_12 |
| ir.cpp:1476:14:1476:14 | StoreValue | r1476_1 |
| ir.cpp:1477:14:1477:16 | Address | &:r1477_1 |
| ir.cpp:1477:20:1477:21 | Address | &:r1477_2 |
| ir.cpp:1477:20:1477:21 | Load | m1475_7 |
| ir.cpp:1477:20:1477:21 | StoreValue | r1477_5 |
| ir.cpp:1477:20:1477:21 | Unary | r1477_3 |
| ir.cpp:1477:20:1477:21 | Unary | r1477_4 |
| ir.cpp:1478:13:1478:13 | Address | &:r1478_1 |
| ir.cpp:1478:17:1478:18 | Address | &:r1478_2 |
| ir.cpp:1478:17:1478:18 | Address | &:r1478_3 |
| ir.cpp:1478:17:1478:18 | Load | m1475_7 |
| ir.cpp:1478:17:1478:18 | Load | m1476_5 |
| ir.cpp:1478:17:1478:18 | StoreValue | r1478_4 |
| ir.cpp:1482:8:1482:8 | Address | &:r1482_5 |
| ir.cpp:1482:8:1482:8 | Address | &:r1482_5 |
| ir.cpp:1482:8:1482:8 | Address | &:r1482_7 |
| ir.cpp:1482:8:1482:8 | Address | &:r1482_7 |
| ir.cpp:1482:8:1482:8 | ChiPartial | partial:m1482_3 |
| ir.cpp:1482:8:1482:8 | ChiTotal | total:m1482_2 |
| ir.cpp:1482:8:1482:8 | Load | m1482_6 |
| ir.cpp:1482:8:1482:8 | SideEffect | m1482_3 |
| ir.cpp:1482:8:1482:8 | SideEffect | m1482_8 |
| ir.cpp:1489:6:1489:35 | ChiPartial | partial:m1489_3 |
| ir.cpp:1489:6:1489:35 | ChiTotal | total:m1489_2 |
| ir.cpp:1489:6:1489:35 | SideEffect | ~m1511_6 |
| ir.cpp:1490:39:1490:39 | Address | &:r1490_1 |
| ir.cpp:1490:39:1490:39 | Address | &:r1490_1 |
| ir.cpp:1490:39:1490:39 | Arg(this) | this:r1490_1 |
| ir.cpp:1490:39:1490:39 | CallTarget | func:r1490_3 |
| ir.cpp:1490:39:1490:39 | ChiPartial | partial:m1490_5 |
| ir.cpp:1490:39:1490:39 | ChiPartial | partial:m1490_7 |
| ir.cpp:1490:39:1490:39 | ChiTotal | total:m1489_4 |
| ir.cpp:1490:39:1490:39 | ChiTotal | total:m1490_2 |
| ir.cpp:1490:39:1490:39 | SideEffect | ~m1489_4 |
| ir.cpp:1493:14:1493:14 | Address | &:r1493_1 |
| ir.cpp:1493:15:1493:15 | Address | &:r1493_5 |
| ir.cpp:1493:18:1493:18 | Address | &:r1493_9 |
| ir.cpp:1493:21:1493:21 | Address | &:r1493_13 |
| ir.cpp:1493:24:1493:24 | Address | &:r1493_17 |
| ir.cpp:1493:29:1493:29 | Address | &:r1493_2 |
| ir.cpp:1493:29:1493:29 | Load | m1490_8 |
| ir.cpp:1493:29:1493:29 | StoreValue | r1493_3 |
| ir.cpp:1493:30:1493:30 | Address | &:r1493_19 |
| ir.cpp:1493:30:1493:30 | Load | ~m1493_4 |
| ir.cpp:1493:30:1493:30 | StoreValue | r1493_7 |
| ir.cpp:1493:30:1493:30 | StoreValue | r1493_11 |
| ir.cpp:1493:30:1493:30 | StoreValue | r1493_15 |
| ir.cpp:1493:30:1493:30 | StoreValue | r1493_21 |
| ir.cpp:1493:30:1493:30 | Unary | r1493_6 |
| ir.cpp:1493:30:1493:30 | Unary | r1493_10 |
| ir.cpp:1493:30:1493:30 | Unary | r1493_14 |
| ir.cpp:1493:30:1493:30 | Unary | r1493_18 |
| ir.cpp:1493:30:1493:30 | Unary | r1493_20 |
| ir.cpp:1494:9:1494:9 | Address | &:r1494_2 |
| ir.cpp:1494:13:1494:15 | StoreValue | r1494_1 |
| ir.cpp:1495:17:1495:18 | Address | &:r1495_1 |
| ir.cpp:1495:22:1495:22 | StoreValue | r1495_3 |
| ir.cpp:1495:22:1495:22 | Unary | r1495_2 |
| ir.cpp:1496:13:1496:13 | Address | &:r1496_1 |
| ir.cpp:1496:17:1496:17 | Address | &:r1496_2 |
| ir.cpp:1496:17:1496:17 | Load | m1493_8 |
| ir.cpp:1496:17:1496:17 | StoreValue | r1496_3 |
| ir.cpp:1497:9:1497:9 | Address | &:r1497_2 |
| ir.cpp:1497:13:1497:13 | StoreValue | r1497_1 |
| ir.cpp:1498:14:1498:15 | Address | &:r1498_1 |
| ir.cpp:1498:19:1498:19 | StoreValue | r1498_3 |
| ir.cpp:1498:19:1498:19 | Unary | r1498_2 |
| ir.cpp:1499:13:1499:13 | Address | &:r1499_1 |
| ir.cpp:1499:17:1499:17 | Address | &:r1499_2 |
| ir.cpp:1499:17:1499:17 | Load | m1497_3 |
| ir.cpp:1499:17:1499:17 | StoreValue | r1499_3 |
| ir.cpp:1503:14:1503:35 | Address | &:r1503_1 |
| ir.cpp:1503:39:1503:39 | Address | &:r1503_2 |
| ir.cpp:1503:39:1503:39 | Load | m1490_8 |
| ir.cpp:1503:39:1503:39 | StoreValue | r1503_3 |
| ir.cpp:1504:15:1504:15 | Address | &:r1504_1 |
| ir.cpp:1504:19:1504:40 | Unary | r1504_2 |
| ir.cpp:1504:19:1504:42 | StoreValue | r1504_4 |
| ir.cpp:1504:42:1504:42 | Unary | r1504_3 |
| ir.cpp:1505:15:1505:15 | Address | &:r1505_1 |
| ir.cpp:1505:19:1505:40 | Unary | r1505_2 |
| ir.cpp:1505:19:1505:42 | StoreValue | r1505_4 |
| ir.cpp:1505:42:1505:42 | Unary | r1505_3 |
| ir.cpp:1507:15:1507:15 | Address | &:r1507_1 |
| ir.cpp:1507:19:1507:40 | Unary | r1507_2 |
| ir.cpp:1507:19:1507:42 | StoreValue | r1507_6 |
| ir.cpp:1507:19:1507:42 | Unary | r1507_5 |
| ir.cpp:1507:42:1507:42 | Address | &:r1507_3 |
| ir.cpp:1507:42:1507:42 | Load | ~m1503_4 |
| ir.cpp:1507:42:1507:42 | Unary | r1507_4 |
| ir.cpp:1508:9:1508:9 | Address | &:r1508_2 |
| ir.cpp:1508:9:1508:9 | Address | &:r1508_4 |
| ir.cpp:1508:9:1508:9 | Load | m1505_5 |
| ir.cpp:1508:9:1508:9 | Unary | r1508_3 |
| ir.cpp:1508:9:1508:15 | ChiPartial | partial:m1508_5 |
| ir.cpp:1508:9:1508:15 | ChiTotal | total:m1503_4 |
| ir.cpp:1508:13:1508:15 | StoreValue | r1508_1 |
| ir.cpp:1509:17:1509:18 | Address | &:r1509_1 |
| ir.cpp:1509:22:1509:22 | Address | &:r1509_2 |
| ir.cpp:1509:22:1509:22 | Load | m1505_5 |
| ir.cpp:1509:22:1509:22 | StoreValue | r1509_5 |
| ir.cpp:1509:22:1509:22 | Unary | r1509_3 |
| ir.cpp:1509:22:1509:22 | Unary | r1509_4 |
| ir.cpp:1510:13:1510:13 | Address | &:r1510_1 |
| ir.cpp:1510:17:1510:17 | Address | &:r1510_2 |
| ir.cpp:1510:17:1510:17 | Address | &:r1510_3 |
| ir.cpp:1510:17:1510:17 | Load | m1504_5 |
| ir.cpp:1510:17:1510:17 | Load | ~m1503_4 |
| ir.cpp:1510:17:1510:17 | StoreValue | r1510_4 |
| ir.cpp:1511:9:1511:9 | Address | &:r1511_2 |
| ir.cpp:1511:9:1511:9 | Address | &:r1511_4 |
| ir.cpp:1511:9:1511:9 | Load | m1507_7 |
| ir.cpp:1511:9:1511:9 | Unary | r1511_3 |
| ir.cpp:1511:9:1511:13 | ChiPartial | partial:m1511_5 |
| ir.cpp:1511:9:1511:13 | ChiTotal | total:m1490_6 |
| ir.cpp:1511:13:1511:13 | StoreValue | r1511_1 |
| ir.cpp:1512:14:1512:15 | Address | &:r1512_1 |
| ir.cpp:1512:19:1512:19 | Address | &:r1512_2 |
| ir.cpp:1512:19:1512:19 | Load | m1507_7 |
| ir.cpp:1512:19:1512:19 | StoreValue | r1512_5 |
| ir.cpp:1512:19:1512:19 | Unary | r1512_3 |
| ir.cpp:1512:19:1512:19 | Unary | r1512_4 |
| ir.cpp:1513:13:1513:13 | Address | &:r1513_1 |
| ir.cpp:1513:17:1513:17 | Address | &:r1513_2 |
| ir.cpp:1513:17:1513:17 | Address | &:r1513_3 |
| ir.cpp:1513:17:1513:17 | Load | m1507_7 |
| ir.cpp:1513:17:1513:17 | Load | ~m1511_6 |
| ir.cpp:1513:17:1513:17 | StoreValue | r1513_4 |
| ir.cpp:1542:8:1542:8 | Address | &:r1542_5 |
| ir.cpp:1542:8:1542:8 | Address | &:r1542_5 |
| ir.cpp:1542:8:1542:8 | Address | &:r1542_7 |
| ir.cpp:1542:8:1542:8 | Address | &:r1542_7 |
| ir.cpp:1542:8:1542:8 | ChiPartial | partial:m1542_3 |
| ir.cpp:1542:8:1542:8 | ChiTotal | total:m1542_2 |
| ir.cpp:1542:8:1542:8 | Load | m1542_6 |
| ir.cpp:1542:8:1542:8 | SideEffect | m1542_3 |
| ir.cpp:1542:8:1542:8 | SideEffect | m1542_8 |
| ir.cpp:1552:54:1552:83 | Address | &:r1552_5 |
| ir.cpp:1552:54:1552:83 | Address | &:r1552_5 |
| ir.cpp:1552:54:1552:83 | Address | &:r1552_7 |
| ir.cpp:1552:54:1552:83 | Address | &:r1552_7 |
| ir.cpp:1552:54:1552:83 | Address | &:r1552_14 |
| ir.cpp:1552:54:1552:83 | ChiPartial | partial:m1552_3 |
| ir.cpp:1552:54:1552:83 | ChiTotal | total:m1552_2 |
| ir.cpp:1552:54:1552:83 | Load | m0_2 |
| ir.cpp:1552:54:1552:83 | Load | m1552_6 |
| ir.cpp:1552:54:1552:83 | SideEffect | m1552_3 |
| ir.cpp:1552:54:1552:83 | SideEffect | m1552_8 |
| ir.cpp:1552:89:1552:97 | Address | &:r1552_9 |
| ir.cpp:1552:96:1552:96 | Address | &:r1552_10 |
| ir.cpp:1552:96:1552:96 | Load | m1552_6 |
| ir.cpp:1552:96:1552:96 | Unary | r1552_11 |
| ir.cpp:1552:96:1552:96 | Unary | r1552_12 |
| ir.cpp:1554:54:1554:83 | Address | &:r1554_5 |
| ir.cpp:1554:54:1554:83 | Address | &:r1554_5 |
| ir.cpp:1554:54:1554:83 | Address | &:r1554_7 |
| ir.cpp:1554:54:1554:83 | Address | &:r1554_7 |
| ir.cpp:1554:54:1554:83 | Address | &:r1554_14 |
| ir.cpp:1554:54:1554:83 | ChiPartial | partial:m1554_3 |
| ir.cpp:1554:54:1554:83 | ChiTotal | total:m1554_2 |
| ir.cpp:1554:54:1554:83 | Load | m0_2 |
| ir.cpp:1554:54:1554:83 | Load | m1554_6 |
| ir.cpp:1554:54:1554:83 | SideEffect | m1554_3 |
| ir.cpp:1554:54:1554:83 | SideEffect | m1554_8 |
| ir.cpp:1554:89:1554:97 | Address | &:r1554_9 |
| ir.cpp:1554:96:1554:96 | Address | &:r1554_10 |
| ir.cpp:1554:96:1554:96 | Load | m1554_6 |
| ir.cpp:1554:96:1554:96 | Unary | r1554_11 |
| ir.cpp:1554:96:1554:96 | Unary | r1554_12 |
| ir.cpp:1556:54:1556:83 | Address | &:r1556_5 |
| ir.cpp:1556:54:1556:83 | Address | &:r1556_5 |
| ir.cpp:1556:54:1556:83 | Address | &:r1556_7 |
| ir.cpp:1556:54:1556:83 | Address | &:r1556_7 |
| ir.cpp:1556:54:1556:83 | Address | &:r1556_18 |
| ir.cpp:1556:54:1556:83 | ChiPartial | partial:m1556_3 |
| ir.cpp:1556:54:1556:83 | ChiTotal | total:m1556_2 |
| ir.cpp:1556:54:1556:83 | Load | m1556_6 |
| ir.cpp:1556:54:1556:83 | Load | m1556_16 |
| ir.cpp:1556:54:1556:83 | SideEffect | m1556_3 |
| ir.cpp:1556:54:1556:83 | SideEffect | m1556_8 |
| ir.cpp:1556:89:1556:97 | Address | &:r1556_9 |
| ir.cpp:1556:96:1556:96 | Address | &:r1556_10 |
| ir.cpp:1556:96:1556:96 | Address | &:r1556_12 |
| ir.cpp:1556:96:1556:96 | Load | m1556_6 |
| ir.cpp:1556:96:1556:96 | Load | ~m1556_8 |
| ir.cpp:1556:96:1556:96 | StoreValue | r1556_15 |
| ir.cpp:1556:96:1556:96 | Unary | r1556_11 |
| ir.cpp:1556:96:1556:96 | Unary | r1556_13 |
| ir.cpp:1556:96:1556:96 | Unary | r1556_14 |
| ir.cpp:1558:6:1558:29 | ChiPartial | partial:m1558_3 |
| ir.cpp:1558:6:1558:29 | ChiTotal | total:m1558_2 |
| ir.cpp:1558:6:1558:29 | SideEffect | ~m1579_6 |
| ir.cpp:1559:28:1559:28 | Address | &:r1559_1 |
| ir.cpp:1559:28:1559:28 | Address | &:r1559_1 |
| ir.cpp:1559:28:1559:28 | Arg(this) | this:r1559_1 |
| ir.cpp:1559:28:1559:28 | CallTarget | func:r1559_3 |
| ir.cpp:1559:28:1559:28 | ChiPartial | partial:m1559_5 |
| ir.cpp:1559:28:1559:28 | ChiPartial | partial:m1559_7 |
| ir.cpp:1559:28:1559:28 | ChiTotal | total:m1558_4 |
| ir.cpp:1559:28:1559:28 | ChiTotal | total:m1559_2 |
| ir.cpp:1559:28:1559:28 | SideEffect | ~m1558_4 |
| ir.cpp:1562:14:1562:14 | Address | &:r1562_1 |
| ir.cpp:1562:14:1562:14 | Address | &:r1562_6 |
| ir.cpp:1562:14:1562:14 | Address | &:r1562_6 |
| ir.cpp:1562:14:1562:14 | Address | &:r1562_18 |
| ir.cpp:1562:14:1562:14 | Address | &:r1562_18 |
| ir.cpp:1562:14:1562:14 | Address | &:r1562_30 |
| ir.cpp:1562:14:1562:14 | Address | &:r1562_30 |
| ir.cpp:1562:14:1562:14 | Arg(this) | this:r1562_6 |
| ir.cpp:1562:14:1562:14 | Arg(this) | this:r1562_18 |
| ir.cpp:1562:14:1562:14 | Arg(this) | this:r1562_30 |
| ir.cpp:1562:14:1562:14 | CallTarget | func:r1562_7 |
| ir.cpp:1562:14:1562:14 | CallTarget | func:r1562_19 |
| ir.cpp:1562:14:1562:14 | CallTarget | func:r1562_31 |
| ir.cpp:1562:14:1562:14 | ChiPartial | partial:m1562_9 |
| ir.cpp:1562:14:1562:14 | ChiPartial | partial:m1562_12 |
| ir.cpp:1562:14:1562:14 | ChiPartial | partial:m1562_21 |
| ir.cpp:1562:14:1562:14 | ChiPartial | partial:m1562_24 |
| ir.cpp:1562:14:1562:14 | ChiPartial | partial:m1562_33 |
| ir.cpp:1562:14:1562:14 | ChiPartial | partial:m1562_36 |
| ir.cpp:1562:14:1562:14 | ChiTotal | total:m1559_6 |
| ir.cpp:1562:14:1562:14 | ChiTotal | total:m1562_4 |
| ir.cpp:1562:14:1562:14 | ChiTotal | total:m1562_10 |
| ir.cpp:1562:14:1562:14 | ChiTotal | total:m1562_13 |
| ir.cpp:1562:14:1562:14 | ChiTotal | total:m1562_22 |
| ir.cpp:1562:14:1562:14 | ChiTotal | total:m1562_25 |
| ir.cpp:1562:14:1562:14 | SideEffect | m1562_4 |
| ir.cpp:1562:14:1562:14 | SideEffect | m1562_13 |
| ir.cpp:1562:14:1562:14 | SideEffect | m1562_25 |
| ir.cpp:1562:14:1562:14 | SideEffect | ~m1559_6 |
| ir.cpp:1562:14:1562:14 | SideEffect | ~m1562_10 |
| ir.cpp:1562:14:1562:14 | SideEffect | ~m1562_22 |
| ir.cpp:1562:14:1562:14 | Unary | r1562_8 |
| ir.cpp:1562:14:1562:14 | Unary | r1562_20 |
| ir.cpp:1562:14:1562:14 | Unary | r1562_32 |
| ir.cpp:1562:14:1562:27 | StoreValue | r1562_15 |
| ir.cpp:1562:14:1562:27 | StoreValue | r1562_27 |
| ir.cpp:1562:14:1562:27 | StoreValue | r1562_39 |
| ir.cpp:1562:14:1562:27 | Unary | r1562_14 |
| ir.cpp:1562:14:1562:27 | Unary | r1562_26 |
| ir.cpp:1562:14:1562:27 | Unary | r1562_38 |
| ir.cpp:1562:15:1562:15 | Address | &:r1562_5 |
| ir.cpp:1562:18:1562:18 | Address | &:r1562_17 |
| ir.cpp:1562:21:1562:21 | Address | &:r1562_29 |
| ir.cpp:1562:26:1562:26 | Address | &:r1562_2 |
| ir.cpp:1562:26:1562:26 | Load | m1559_8 |
| ir.cpp:1562:26:1562:26 | StoreValue | r1562_3 |
| ir.cpp:1563:9:1563:9 | Address | &:r1563_2 |
| ir.cpp:1563:9:1563:9 | Address | &:r1563_4 |
| ir.cpp:1563:9:1563:9 | Load | m1562_28 |
| ir.cpp:1563:9:1563:9 | Unary | r1563_3 |
| ir.cpp:1563:9:1563:15 | ChiPartial | partial:m1563_5 |
| ir.cpp:1563:9:1563:15 | ChiTotal | total:m1562_37 |
| ir.cpp:1563:13:1563:15 | StoreValue | r1563_1 |
| ir.cpp:1564:17:1564:18 | Address | &:r1564_1 |
| ir.cpp:1564:22:1564:22 | Address | &:r1564_2 |
| ir.cpp:1564:22:1564:22 | Load | m1562_28 |
| ir.cpp:1564:22:1564:22 | StoreValue | r1564_5 |
| ir.cpp:1564:22:1564:22 | Unary | r1564_3 |
| ir.cpp:1564:22:1564:22 | Unary | r1564_4 |
| ir.cpp:1565:13:1565:13 | Address | &:r1565_1 |
| ir.cpp:1565:17:1565:17 | Address | &:r1565_2 |
| ir.cpp:1565:17:1565:17 | Address | &:r1565_3 |
| ir.cpp:1565:17:1565:17 | Load | m1562_16 |
| ir.cpp:1565:17:1565:17 | Load | ~m1562_37 |
| ir.cpp:1565:17:1565:17 | StoreValue | r1565_4 |
| ir.cpp:1566:9:1566:9 | Address | &:r1566_2 |
| ir.cpp:1566:9:1566:9 | Address | &:r1566_4 |
| ir.cpp:1566:9:1566:9 | Load | m1562_40 |
| ir.cpp:1566:9:1566:9 | Unary | r1566_3 |
| ir.cpp:1566:9:1566:13 | ChiPartial | partial:m1566_5 |
| ir.cpp:1566:9:1566:13 | ChiTotal | total:m1562_34 |
| ir.cpp:1566:13:1566:13 | StoreValue | r1566_1 |
| ir.cpp:1567:14:1567:15 | Address | &:r1567_1 |
| ir.cpp:1567:19:1567:19 | Address | &:r1567_2 |
| ir.cpp:1567:19:1567:19 | Load | m1562_40 |
| ir.cpp:1567:19:1567:19 | StoreValue | r1567_5 |
| ir.cpp:1567:19:1567:19 | Unary | r1567_3 |
| ir.cpp:1567:19:1567:19 | Unary | r1567_4 |
| ir.cpp:1568:13:1568:13 | Address | &:r1568_1 |
| ir.cpp:1568:17:1568:17 | Address | &:r1568_2 |
| ir.cpp:1568:17:1568:17 | Address | &:r1568_3 |
| ir.cpp:1568:17:1568:17 | Load | m1562_40 |
| ir.cpp:1568:17:1568:17 | Load | ~m1566_6 |
| ir.cpp:1568:17:1568:17 | StoreValue | r1568_4 |
| ir.cpp:1572:14:1572:35 | Address | &:r1572_1 |
| ir.cpp:1572:39:1572:39 | Address | &:r1572_2 |
| ir.cpp:1572:39:1572:39 | Load | m1559_8 |
| ir.cpp:1572:39:1572:39 | StoreValue | r1572_3 |
| ir.cpp:1573:15:1573:15 | Address | &:r1573_1 |
| ir.cpp:1573:19:1573:40 | Address | &:r1573_2 |
| ir.cpp:1573:19:1573:40 | Address | &:r1573_2 |
| ir.cpp:1573:19:1573:40 | Arg(this) | this:r1573_2 |
| ir.cpp:1573:19:1573:40 | ChiPartial | partial:m1573_8 |
| ir.cpp:1573:19:1573:40 | ChiTotal | total:m1572_4 |
| ir.cpp:1573:19:1573:40 | SideEffect | m1572_4 |
| ir.cpp:1573:42:1573:47 | CallTarget | func:r1573_3 |
| ir.cpp:1573:42:1573:47 | ChiPartial | partial:m1573_5 |
| ir.cpp:1573:42:1573:47 | ChiTotal | total:m1566_6 |
| ir.cpp:1573:42:1573:47 | SideEffect | ~m1566_6 |
| ir.cpp:1573:42:1573:47 | Unary | r1573_4 |
| ir.cpp:1573:42:1573:50 | StoreValue | r1573_11 |
| ir.cpp:1573:42:1573:50 | Unary | r1573_10 |
| ir.cpp:1574:15:1574:15 | Address | &:r1574_1 |
| ir.cpp:1574:19:1574:40 | Address | &:r1574_2 |
| ir.cpp:1574:19:1574:40 | Address | &:r1574_2 |
| ir.cpp:1574:19:1574:40 | Arg(this) | this:r1574_2 |
| ir.cpp:1574:19:1574:40 | ChiPartial | partial:m1574_8 |
| ir.cpp:1574:19:1574:40 | ChiTotal | total:m1573_9 |
| ir.cpp:1574:19:1574:40 | SideEffect | m1573_9 |
| ir.cpp:1574:42:1574:47 | CallTarget | func:r1574_3 |
| ir.cpp:1574:42:1574:47 | ChiPartial | partial:m1574_5 |
| ir.cpp:1574:42:1574:47 | ChiTotal | total:m1573_6 |
| ir.cpp:1574:42:1574:47 | SideEffect | ~m1573_6 |
| ir.cpp:1574:42:1574:47 | Unary | r1574_4 |
| ir.cpp:1574:42:1574:50 | StoreValue | r1574_11 |
| ir.cpp:1574:42:1574:50 | Unary | r1574_10 |
| ir.cpp:1575:15:1575:15 | Address | &:r1575_1 |
| ir.cpp:1575:19:1575:40 | Address | &:r1575_2 |
| ir.cpp:1575:19:1575:40 | Address | &:r1575_2 |
| ir.cpp:1575:19:1575:40 | Arg(this) | this:r1575_2 |
| ir.cpp:1575:19:1575:40 | ChiPartial | partial:m1575_8 |
| ir.cpp:1575:19:1575:40 | ChiTotal | total:m1574_9 |
| ir.cpp:1575:19:1575:40 | SideEffect | m1574_9 |
| ir.cpp:1575:42:1575:47 | CallTarget | func:r1575_3 |
| ir.cpp:1575:42:1575:47 | ChiPartial | partial:m1575_5 |
| ir.cpp:1575:42:1575:47 | ChiTotal | total:m1574_6 |
| ir.cpp:1575:42:1575:47 | SideEffect | ~m1574_6 |
| ir.cpp:1575:42:1575:47 | Unary | r1575_4 |
| ir.cpp:1575:42:1575:50 | StoreValue | r1575_11 |
| ir.cpp:1575:42:1575:50 | Unary | r1575_10 |
| ir.cpp:1576:9:1576:9 | Address | &:r1576_2 |
| ir.cpp:1576:9:1576:9 | Address | &:r1576_4 |
| ir.cpp:1576:9:1576:9 | Load | m1574_12 |
| ir.cpp:1576:9:1576:9 | Unary | r1576_3 |
| ir.cpp:1576:9:1576:15 | ChiPartial | partial:m1576_5 |
| ir.cpp:1576:9:1576:15 | ChiTotal | total:m1575_9 |
| ir.cpp:1576:13:1576:15 | StoreValue | r1576_1 |
| ir.cpp:1577:17:1577:18 | Address | &:r1577_1 |
| ir.cpp:1577:22:1577:22 | Address | &:r1577_2 |
| ir.cpp:1577:22:1577:22 | Load | m1574_12 |
| ir.cpp:1577:22:1577:22 | StoreValue | r1577_5 |
| ir.cpp:1577:22:1577:22 | Unary | r1577_3 |
| ir.cpp:1577:22:1577:22 | Unary | r1577_4 |
| ir.cpp:1578:13:1578:13 | Address | &:r1578_1 |
| ir.cpp:1578:17:1578:17 | Address | &:r1578_2 |
| ir.cpp:1578:17:1578:17 | Address | &:r1578_3 |
| ir.cpp:1578:17:1578:17 | Load | m1573_12 |
| ir.cpp:1578:17:1578:17 | Load | ~m1575_9 |
| ir.cpp:1578:17:1578:17 | StoreValue | r1578_4 |
| ir.cpp:1579:9:1579:9 | Address | &:r1579_2 |
| ir.cpp:1579:9:1579:9 | Address | &:r1579_4 |
| ir.cpp:1579:9:1579:9 | Load | m1575_12 |
| ir.cpp:1579:9:1579:9 | Unary | r1579_3 |
| ir.cpp:1579:9:1579:13 | ChiPartial | partial:m1579_5 |
| ir.cpp:1579:9:1579:13 | ChiTotal | total:m1575_6 |
| ir.cpp:1579:13:1579:13 | StoreValue | r1579_1 |
| ir.cpp:1580:14:1580:15 | Address | &:r1580_1 |
| ir.cpp:1580:19:1580:19 | Address | &:r1580_2 |
| ir.cpp:1580:19:1580:19 | Load | m1575_12 |
| ir.cpp:1580:19:1580:19 | StoreValue | r1580_5 |
| ir.cpp:1580:19:1580:19 | Unary | r1580_3 |
| ir.cpp:1580:19:1580:19 | Unary | r1580_4 |
| ir.cpp:1581:13:1581:13 | Address | &:r1581_1 |
| ir.cpp:1581:17:1581:17 | Address | &:r1581_2 |
| ir.cpp:1581:17:1581:17 | Address | &:r1581_3 |
| ir.cpp:1581:17:1581:17 | Load | m1575_12 |
| ir.cpp:1581:17:1581:17 | Load | ~m1579_6 |
| ir.cpp:1581:17:1581:17 | StoreValue | r1581_4 |
| 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

@@ -7896,6 +7896,447 @@ ir.cpp:
# 1457| v1457_13(void) = AliasedUse : ~m?
# 1457| v1457_14(void) = ExitFunction :
# 1462| void array_structured_binding()
# 1462| Block 0
# 1462| v1462_1(void) = EnterFunction :
# 1462| mu1462_2(unknown) = AliasedDefinition :
# 1462| mu1462_3(unknown) = InitializeNonLocal :
# 1463| r1463_1(glval<int[2]>) = VariableAddress[xs] :
# 1463| mu1463_2(int[2]) = Uninitialized[xs] : &:r1463_1
# 1463| r1463_3(int) = Constant[0] :
# 1463| r1463_4(glval<int>) = PointerAdd[4] : r1463_1, r1463_3
# 1463| r1463_5(int) = Constant[1] :
# 1463| mu1463_6(int) = Store[?] : &:r1463_4, r1463_5
# 1463| r1463_7(int) = Constant[1] :
# 1463| r1463_8(glval<int>) = PointerAdd[4] : r1463_1, r1463_7
# 1463| r1463_9(int) = Constant[2] :
# 1463| mu1463_10(int) = Store[?] : &:r1463_8, r1463_9
# 1466| r1466_1(glval<int(&)[2]>) = VariableAddress[(unnamed local variable)] :
# 1466| r1466_2(glval<int[2]>) = VariableAddress[xs] :
# 1466| r1466_3(int(&)[2]) = CopyValue : r1466_2
# 1466| mu1466_4(int(&)[2]) = Store[(unnamed local variable)] : &:r1466_1, r1466_3
# 1466| r1466_5(glval<int>) = VariableAddress[x0] :
#-----| r0_1(glval<int(&)[2]>) = VariableAddress[(unnamed local variable)] :
#-----| r0_2(int(&)[2]) = Load[(unnamed local variable)] : &:r0_1, ~m?
#-----| r0_3(glval<int[2]>) = CopyValue : r0_2
#-----| r0_4(int *) = Convert : r0_3
#-----| r0_5(unsigned long) = Constant[0] :
#-----| r0_6(glval<int>) = PointerAdd[4] : r0_4, r0_5
#-----| mu0_7(int) = Store[x0] : &:r1466_5, r0_6
# 1466| r1466_6(glval<int>) = VariableAddress[x1] :
#-----| r0_8(glval<int(&)[2]>) = VariableAddress[(unnamed local variable)] :
#-----| r0_9(int(&)[2]) = Load[(unnamed local variable)] : &:r0_8, ~m?
#-----| r0_10(glval<int[2]>) = CopyValue : r0_9
#-----| r0_11(int *) = Convert : r0_10
#-----| r0_12(unsigned long) = Constant[1] :
#-----| r0_13(glval<int>) = PointerAdd[4] : r0_11, r0_12
#-----| mu0_14(int) = Store[x1] : &:r1466_6, r0_13
# 1467| r1467_1(int) = Constant[3] :
# 1467| r1467_2(glval<int>) = VariableAddress[x1] :
# 1467| mu1467_3(int) = Store[x1] : &:r1467_2, r1467_1
# 1468| r1468_1(glval<int &>) = VariableAddress[rx1] :
# 1468| r1468_2(glval<int>) = VariableAddress[x1] :
# 1468| r1468_3(int &) = CopyValue : r1468_2
# 1468| mu1468_4(int &) = Store[rx1] : &:r1468_1, r1468_3
# 1469| r1469_1(glval<int>) = VariableAddress[x] :
# 1469| r1469_2(glval<int>) = VariableAddress[x1] :
# 1469| r1469_3(int) = Load[x1] : &:r1469_2, ~m?
# 1469| mu1469_4(int) = Store[x] : &:r1469_1, r1469_3
# 1473| r1473_1(glval<int(&)[2]>) = VariableAddress[unnamed_local_variable] :
# 1473| r1473_2(glval<int[2]>) = VariableAddress[xs] :
# 1473| r1473_3(int(&)[2]) = CopyValue : r1473_2
# 1473| mu1473_4(int(&)[2]) = Store[unnamed_local_variable] : &:r1473_1, r1473_3
# 1474| r1474_1(glval<int &>) = VariableAddress[x0] :
# 1474| r1474_2(glval<int[2]>) = VariableAddress[xs] :
# 1474| r1474_3(int *) = Convert : r1474_2
# 1474| r1474_4(int) = Constant[0] :
# 1474| r1474_5(glval<int>) = PointerAdd[4] : r1474_3, r1474_4
# 1474| r1474_6(int &) = CopyValue : r1474_5
# 1474| mu1474_7(int &) = Store[x0] : &:r1474_1, r1474_6
# 1475| r1475_1(glval<int &>) = VariableAddress[x1] :
# 1475| r1475_2(glval<int[2]>) = VariableAddress[xs] :
# 1475| r1475_3(int *) = Convert : r1475_2
# 1475| r1475_4(int) = Constant[1] :
# 1475| r1475_5(glval<int>) = PointerAdd[4] : r1475_3, r1475_4
# 1475| r1475_6(int &) = CopyValue : r1475_5
# 1475| mu1475_7(int &) = Store[x1] : &:r1475_1, r1475_6
# 1476| r1476_1(int) = Constant[3] :
# 1476| r1476_2(glval<int &>) = VariableAddress[x1] :
# 1476| r1476_3(int &) = Load[x1] : &:r1476_2, ~m?
# 1476| r1476_4(glval<int>) = CopyValue : r1476_3
# 1476| mu1476_5(int) = Store[?] : &:r1476_4, r1476_1
# 1477| r1477_1(glval<int &>) = VariableAddress[rx1] :
# 1477| r1477_2(glval<int &>) = VariableAddress[x1] :
# 1477| r1477_3(int &) = Load[x1] : &:r1477_2, ~m?
# 1477| r1477_4(glval<int>) = CopyValue : r1477_3
# 1477| r1477_5(int &) = CopyValue : r1477_4
# 1477| mu1477_6(int &) = Store[rx1] : &:r1477_1, r1477_5
# 1478| r1478_1(glval<int>) = VariableAddress[x] :
# 1478| r1478_2(glval<int &>) = VariableAddress[x1] :
# 1478| r1478_3(int &) = Load[x1] : &:r1478_2, ~m?
# 1478| r1478_4(int) = Load[?] : &:r1478_3, ~m?
# 1478| mu1478_5(int) = Store[x] : &:r1478_1, r1478_4
# 1480| v1480_1(void) = NoOp :
# 1462| v1462_4(void) = ReturnVoid :
# 1462| v1462_5(void) = AliasedUse : ~m?
# 1462| v1462_6(void) = ExitFunction :
# 1482| void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct()
# 1482| Block 0
# 1482| v1482_1(void) = EnterFunction :
# 1482| mu1482_2(unknown) = AliasedDefinition :
# 1482| mu1482_3(unknown) = InitializeNonLocal :
# 1482| r1482_4(glval<unknown>) = VariableAddress[#this] :
# 1482| mu1482_5(glval<StructuredBindingDataMemberStruct>) = InitializeParameter[#this] : &:r1482_4
# 1482| r1482_6(glval<StructuredBindingDataMemberStruct>) = Load[#this] : &:r1482_4, ~m?
# 1482| mu1482_7(StructuredBindingDataMemberStruct) = InitializeIndirection[#this] : &:r1482_6
# 1482| v1482_8(void) = NoOp :
# 1482| v1482_9(void) = ReturnIndirection[#this] : &:r1482_6, ~m?
# 1482| v1482_10(void) = ReturnVoid :
# 1482| v1482_11(void) = AliasedUse : ~m?
# 1482| v1482_12(void) = ExitFunction :
# 1489| void data_member_structured_binding()
# 1489| Block 0
# 1489| v1489_1(void) = EnterFunction :
# 1489| mu1489_2(unknown) = AliasedDefinition :
# 1489| mu1489_3(unknown) = InitializeNonLocal :
# 1490| r1490_1(glval<StructuredBindingDataMemberStruct>) = VariableAddress[s] :
# 1490| mu1490_2(StructuredBindingDataMemberStruct) = Uninitialized[s] : &:r1490_1
# 1490| r1490_3(glval<unknown>) = FunctionAddress[StructuredBindingDataMemberStruct] :
# 1490| v1490_4(void) = Call[StructuredBindingDataMemberStruct] : func:r1490_3, this:r1490_1
# 1490| mu1490_5(unknown) = ^CallSideEffect : ~m?
# 1490| mu1490_6(StructuredBindingDataMemberStruct) = ^IndirectMayWriteSideEffect[-1] : &:r1490_1
# 1493| r1493_1(glval<StructuredBindingDataMemberStruct>) = VariableAddress[(unnamed local variable)] :
# 1493| r1493_2(glval<StructuredBindingDataMemberStruct>) = VariableAddress[s] :
# 1493| r1493_3(StructuredBindingDataMemberStruct) = Load[s] : &:r1493_2, ~m?
# 1493| mu1493_4(StructuredBindingDataMemberStruct) = Store[(unnamed local variable)] : &:r1493_1, r1493_3
# 1493| r1493_5(glval<int>) = VariableAddress[i] :
# 1493| r1493_6(glval<StructuredBindingDataMemberStruct>) = VariableAddress[(unnamed local variable)] :
# 1493| r1493_7(glval<int>) = FieldAddress[i] : r1493_6
# 1493| mu1493_8(int) = Store[i] : &:r1493_5, r1493_7
# 1493| r1493_9(glval<double>) = VariableAddress[d] :
# 1493| r1493_10(glval<StructuredBindingDataMemberStruct>) = VariableAddress[(unnamed local variable)] :
# 1493| r1493_11(glval<double>) = FieldAddress[d] : r1493_10
# 1493| mu1493_12(double) = Store[d] : &:r1493_9, r1493_11
# 1493| r1493_13(glval<unsigned int>) = VariableAddress[b] :
# 1493| r1493_14(glval<StructuredBindingDataMemberStruct>) = VariableAddress[(unnamed local variable)] :
# 1493| r1493_15(glval<unsigned int>) = FieldAddress[b] : r1493_14
# 1493| mu1493_16(unsigned int) = Store[b] : &:r1493_13, r1493_15
# 1493| r1493_17(glval<int>) = VariableAddress[r] :
# 1493| r1493_18(glval<StructuredBindingDataMemberStruct>) = VariableAddress[(unnamed local variable)] :
# 1493| r1493_19(glval<int &>) = FieldAddress[r] : r1493_18
# 1493| r1493_20(int &) = Load[?] : &:r1493_19, ~m?
# 1493| r1493_21(glval<int>) = CopyValue : r1493_20
# 1493| mu1493_22(int) = Store[r] : &:r1493_17, r1493_21
# 1494| r1494_1(double) = Constant[4.0] :
# 1494| r1494_2(glval<double>) = VariableAddress[d] :
# 1494| mu1494_3(double) = Store[d] : &:r1494_2, r1494_1
# 1495| r1495_1(glval<double &>) = VariableAddress[rd] :
# 1495| r1495_2(glval<double>) = VariableAddress[d] :
# 1495| r1495_3(double &) = CopyValue : r1495_2
# 1495| mu1495_4(double &) = Store[rd] : &:r1495_1, r1495_3
# 1496| r1496_1(glval<int>) = VariableAddress[v] :
# 1496| r1496_2(glval<int>) = VariableAddress[i] :
# 1496| r1496_3(int) = Load[i] : &:r1496_2, ~m?
# 1496| mu1496_4(int) = Store[v] : &:r1496_1, r1496_3
# 1497| r1497_1(int) = Constant[5] :
# 1497| r1497_2(glval<int>) = VariableAddress[r] :
# 1497| mu1497_3(int) = Store[r] : &:r1497_2, r1497_1
# 1498| r1498_1(glval<int &>) = VariableAddress[rr] :
# 1498| r1498_2(glval<int>) = VariableAddress[r] :
# 1498| r1498_3(int &) = CopyValue : r1498_2
# 1498| mu1498_4(int &) = Store[rr] : &:r1498_1, r1498_3
# 1499| r1499_1(glval<int>) = VariableAddress[w] :
# 1499| r1499_2(glval<int>) = VariableAddress[r] :
# 1499| r1499_3(int) = Load[r] : &:r1499_2, ~m?
# 1499| mu1499_4(int) = Store[w] : &:r1499_1, r1499_3
# 1503| r1503_1(glval<StructuredBindingDataMemberStruct>) = VariableAddress[unnamed_local_variable] :
# 1503| r1503_2(glval<StructuredBindingDataMemberStruct>) = VariableAddress[s] :
# 1503| r1503_3(StructuredBindingDataMemberStruct) = Load[s] : &:r1503_2, ~m?
# 1503| mu1503_4(StructuredBindingDataMemberStruct) = Store[unnamed_local_variable] : &:r1503_1, r1503_3
# 1504| r1504_1(glval<int &>) = VariableAddress[i] :
# 1504| r1504_2(glval<StructuredBindingDataMemberStruct>) = VariableAddress[unnamed_local_variable] :
# 1504| r1504_3(glval<int>) = FieldAddress[i] : r1504_2
# 1504| r1504_4(int &) = CopyValue : r1504_3
# 1504| mu1504_5(int &) = Store[i] : &:r1504_1, r1504_4
# 1505| r1505_1(glval<double &>) = VariableAddress[d] :
# 1505| r1505_2(glval<StructuredBindingDataMemberStruct>) = VariableAddress[unnamed_local_variable] :
# 1505| r1505_3(glval<double>) = FieldAddress[d] : r1505_2
# 1505| r1505_4(double &) = CopyValue : r1505_3
# 1505| mu1505_5(double &) = Store[d] : &:r1505_1, r1505_4
# 1507| r1507_1(glval<int &>) = VariableAddress[r] :
# 1507| r1507_2(glval<StructuredBindingDataMemberStruct>) = VariableAddress[unnamed_local_variable] :
# 1507| r1507_3(glval<int &>) = FieldAddress[r] : r1507_2
# 1507| r1507_4(int &) = Load[?] : &:r1507_3, ~m?
# 1507| r1507_5(glval<int>) = CopyValue : r1507_4
# 1507| r1507_6(int &) = CopyValue : r1507_5
# 1507| mu1507_7(int &) = Store[r] : &:r1507_1, r1507_6
# 1508| r1508_1(double) = Constant[4.0] :
# 1508| r1508_2(glval<double &>) = VariableAddress[d] :
# 1508| r1508_3(double &) = Load[d] : &:r1508_2, ~m?
# 1508| r1508_4(glval<double>) = CopyValue : r1508_3
# 1508| mu1508_5(double) = Store[?] : &:r1508_4, r1508_1
# 1509| r1509_1(glval<double &>) = VariableAddress[rd] :
# 1509| r1509_2(glval<double &>) = VariableAddress[d] :
# 1509| r1509_3(double &) = Load[d] : &:r1509_2, ~m?
# 1509| r1509_4(glval<double>) = CopyValue : r1509_3
# 1509| r1509_5(double &) = CopyValue : r1509_4
# 1509| mu1509_6(double &) = Store[rd] : &:r1509_1, r1509_5
# 1510| r1510_1(glval<int>) = VariableAddress[v] :
# 1510| r1510_2(glval<int &>) = VariableAddress[i] :
# 1510| r1510_3(int &) = Load[i] : &:r1510_2, ~m?
# 1510| r1510_4(int) = Load[?] : &:r1510_3, ~m?
# 1510| mu1510_5(int) = Store[v] : &:r1510_1, r1510_4
# 1511| r1511_1(int) = Constant[5] :
# 1511| r1511_2(glval<int &>) = VariableAddress[r] :
# 1511| r1511_3(int &) = Load[r] : &:r1511_2, ~m?
# 1511| r1511_4(glval<int>) = CopyValue : r1511_3
# 1511| mu1511_5(int) = Store[?] : &:r1511_4, r1511_1
# 1512| r1512_1(glval<int &>) = VariableAddress[rr] :
# 1512| r1512_2(glval<int &>) = VariableAddress[r] :
# 1512| r1512_3(int &) = Load[r] : &:r1512_2, ~m?
# 1512| r1512_4(glval<int>) = CopyValue : r1512_3
# 1512| r1512_5(int &) = CopyValue : r1512_4
# 1512| mu1512_6(int &) = Store[rr] : &:r1512_1, r1512_5
# 1513| r1513_1(glval<int>) = VariableAddress[w] :
# 1513| r1513_2(glval<int &>) = VariableAddress[r] :
# 1513| r1513_3(int &) = Load[r] : &:r1513_2, ~m?
# 1513| r1513_4(int) = Load[?] : &:r1513_3, ~m?
# 1513| mu1513_5(int) = Store[w] : &:r1513_1, r1513_4
# 1515| v1515_1(void) = NoOp :
# 1489| v1489_4(void) = ReturnVoid :
# 1489| v1489_5(void) = AliasedUse : ~m?
# 1489| v1489_6(void) = ExitFunction :
# 1542| void StructuredBindingTuple::StructuredBindingTuple()
# 1542| Block 0
# 1542| v1542_1(void) = EnterFunction :
# 1542| mu1542_2(unknown) = AliasedDefinition :
# 1542| mu1542_3(unknown) = InitializeNonLocal :
# 1542| r1542_4(glval<unknown>) = VariableAddress[#this] :
# 1542| mu1542_5(glval<StructuredBindingTuple>) = InitializeParameter[#this] : &:r1542_4
# 1542| r1542_6(glval<StructuredBindingTuple>) = Load[#this] : &:r1542_4, ~m?
# 1542| mu1542_7(StructuredBindingTuple) = InitializeIndirection[#this] : &:r1542_6
# 1542| v1542_8(void) = NoOp :
# 1542| v1542_9(void) = ReturnIndirection[#this] : &:r1542_6, ~m?
# 1542| v1542_10(void) = ReturnVoid :
# 1542| v1542_11(void) = AliasedUse : ~m?
# 1542| v1542_12(void) = ExitFunction :
# 1552| std::tuple_element<int 0, StructuredBindingTuple>::type& StructuredBindingTuple::get<int 0>()
# 1552| Block 0
# 1552| v1552_1(void) = EnterFunction :
# 1552| mu1552_2(unknown) = AliasedDefinition :
# 1552| mu1552_3(unknown) = InitializeNonLocal :
# 1552| r1552_4(glval<unknown>) = VariableAddress[#this] :
# 1552| mu1552_5(glval<StructuredBindingTuple>) = InitializeParameter[#this] : &:r1552_4
# 1552| r1552_6(glval<StructuredBindingTuple>) = Load[#this] : &:r1552_4, ~m?
# 1552| mu1552_7(StructuredBindingTuple) = InitializeIndirection[#this] : &:r1552_6
# 1552| r1552_8(glval<int &>) = VariableAddress[#return] :
# 1552| r1552_9(glval<unknown>) = VariableAddress[#this] :
# 1552| r1552_10(StructuredBindingTuple *) = Load[#this] : &:r1552_9, ~m?
# 1552| r1552_11(glval<int>) = FieldAddress[i] : r1552_10
#-----| r0_1(int &) = CopyValue : r1552_11
#-----| mu0_2(int &) = Store[#return] : &:r1552_8, r0_1
# 1552| v1552_12(void) = ReturnIndirection[#this] : &:r1552_6, ~m?
# 1552| r1552_13(glval<int &>) = VariableAddress[#return] :
# 1552| v1552_14(void) = ReturnValue : &:r1552_13, ~m?
# 1552| v1552_15(void) = AliasedUse : ~m?
# 1552| v1552_16(void) = ExitFunction :
# 1554| std::tuple_element<int 1, StructuredBindingTuple>::type& StructuredBindingTuple::get<int 1>()
# 1554| Block 0
# 1554| v1554_1(void) = EnterFunction :
# 1554| mu1554_2(unknown) = AliasedDefinition :
# 1554| mu1554_3(unknown) = InitializeNonLocal :
# 1554| r1554_4(glval<unknown>) = VariableAddress[#this] :
# 1554| mu1554_5(glval<StructuredBindingTuple>) = InitializeParameter[#this] : &:r1554_4
# 1554| r1554_6(glval<StructuredBindingTuple>) = Load[#this] : &:r1554_4, ~m?
# 1554| mu1554_7(StructuredBindingTuple) = InitializeIndirection[#this] : &:r1554_6
# 1554| r1554_8(glval<double &>) = VariableAddress[#return] :
# 1554| r1554_9(glval<unknown>) = VariableAddress[#this] :
# 1554| r1554_10(StructuredBindingTuple *) = Load[#this] : &:r1554_9, ~m?
# 1554| r1554_11(glval<double>) = FieldAddress[d] : r1554_10
#-----| r0_1(double &) = CopyValue : r1554_11
#-----| mu0_2(double &) = Store[#return] : &:r1554_8, r0_1
# 1554| v1554_12(void) = ReturnIndirection[#this] : &:r1554_6, ~m?
# 1554| r1554_13(glval<double &>) = VariableAddress[#return] :
# 1554| v1554_14(void) = ReturnValue : &:r1554_13, ~m?
# 1554| v1554_15(void) = AliasedUse : ~m?
# 1554| v1554_16(void) = ExitFunction :
# 1556| std::tuple_element<int 2, StructuredBindingTuple>::type StructuredBindingTuple::get<int 2>()
# 1556| Block 0
# 1556| v1556_1(void) = EnterFunction :
# 1556| mu1556_2(unknown) = AliasedDefinition :
# 1556| mu1556_3(unknown) = InitializeNonLocal :
# 1556| r1556_4(glval<unknown>) = VariableAddress[#this] :
# 1556| mu1556_5(glval<StructuredBindingTuple>) = InitializeParameter[#this] : &:r1556_4
# 1556| r1556_6(glval<StructuredBindingTuple>) = Load[#this] : &:r1556_4, ~m?
# 1556| mu1556_7(StructuredBindingTuple) = InitializeIndirection[#this] : &:r1556_6
# 1556| r1556_8(glval<int &>) = VariableAddress[#return] :
# 1556| r1556_9(glval<unknown>) = VariableAddress[#this] :
# 1556| r1556_10(StructuredBindingTuple *) = Load[#this] : &:r1556_9, ~m?
# 1556| r1556_11(glval<int &>) = FieldAddress[r] : r1556_10
# 1556| r1556_12(int &) = Load[?] : &:r1556_11, ~m?
# 1556| r1556_13(glval<int>) = CopyValue : r1556_12
# 1556| r1556_14(int &) = CopyValue : r1556_13
# 1556| mu1556_15(int &) = Store[#return] : &:r1556_8, r1556_14
# 1556| v1556_16(void) = ReturnIndirection[#this] : &:r1556_6, ~m?
# 1556| r1556_17(glval<int &>) = VariableAddress[#return] :
# 1556| v1556_18(void) = ReturnValue : &:r1556_17, ~m?
# 1556| v1556_19(void) = AliasedUse : ~m?
# 1556| v1556_20(void) = ExitFunction :
# 1558| void tuple_structured_binding()
# 1558| Block 0
# 1558| v1558_1(void) = EnterFunction :
# 1558| mu1558_2(unknown) = AliasedDefinition :
# 1558| mu1558_3(unknown) = InitializeNonLocal :
# 1559| r1559_1(glval<StructuredBindingTuple>) = VariableAddress[t] :
# 1559| mu1559_2(StructuredBindingTuple) = Uninitialized[t] : &:r1559_1
# 1559| r1559_3(glval<unknown>) = FunctionAddress[StructuredBindingTuple] :
# 1559| v1559_4(void) = Call[StructuredBindingTuple] : func:r1559_3, this:r1559_1
# 1559| mu1559_5(unknown) = ^CallSideEffect : ~m?
# 1559| mu1559_6(StructuredBindingTuple) = ^IndirectMayWriteSideEffect[-1] : &:r1559_1
# 1562| r1562_1(glval<StructuredBindingTuple>) = VariableAddress[(unnamed local variable)] :
# 1562| r1562_2(glval<StructuredBindingTuple>) = VariableAddress[t] :
# 1562| r1562_3(StructuredBindingTuple) = Load[t] : &:r1562_2, ~m?
# 1562| mu1562_4(StructuredBindingTuple) = Store[(unnamed local variable)] : &:r1562_1, r1562_3
# 1562| r1562_5(glval<int &>) = VariableAddress[i] :
# 1562| r1562_6(glval<StructuredBindingTuple>) = VariableAddress[(unnamed local variable)] :
# 1562| r1562_7(glval<unknown>) = FunctionAddress[get] :
# 1562| r1562_8(int &) = Call[get] : func:r1562_7, this:r1562_6
# 1562| mu1562_9(unknown) = ^CallSideEffect : ~m?
# 1562| v1562_10(void) = ^IndirectReadSideEffect[-1] : &:r1562_6, ~m?
# 1562| mu1562_11(StructuredBindingTuple) = ^IndirectMayWriteSideEffect[-1] : &:r1562_6
# 1562| r1562_12(glval<int>) = CopyValue : r1562_8
# 1562| r1562_13(int &) = CopyValue : r1562_12
# 1562| mu1562_14(int &) = Store[i] : &:r1562_5, r1562_13
# 1562| r1562_15(glval<double &>) = VariableAddress[d] :
# 1562| r1562_16(glval<StructuredBindingTuple>) = VariableAddress[(unnamed local variable)] :
# 1562| r1562_17(glval<unknown>) = FunctionAddress[get] :
# 1562| r1562_18(double &) = Call[get] : func:r1562_17, this:r1562_16
# 1562| mu1562_19(unknown) = ^CallSideEffect : ~m?
# 1562| v1562_20(void) = ^IndirectReadSideEffect[-1] : &:r1562_16, ~m?
# 1562| mu1562_21(StructuredBindingTuple) = ^IndirectMayWriteSideEffect[-1] : &:r1562_16
# 1562| r1562_22(glval<double>) = CopyValue : r1562_18
# 1562| r1562_23(double &) = CopyValue : r1562_22
# 1562| mu1562_24(double &) = Store[d] : &:r1562_15, r1562_23
# 1562| r1562_25(glval<int &>) = VariableAddress[r] :
# 1562| r1562_26(glval<StructuredBindingTuple>) = VariableAddress[(unnamed local variable)] :
# 1562| r1562_27(glval<unknown>) = FunctionAddress[get] :
# 1562| r1562_28(int &) = Call[get] : func:r1562_27, this:r1562_26
# 1562| mu1562_29(unknown) = ^CallSideEffect : ~m?
# 1562| v1562_30(void) = ^IndirectReadSideEffect[-1] : &:r1562_26, ~m?
# 1562| mu1562_31(StructuredBindingTuple) = ^IndirectMayWriteSideEffect[-1] : &:r1562_26
# 1562| r1562_32(glval<int>) = CopyValue : r1562_28
# 1562| r1562_33(int &) = CopyValue : r1562_32
# 1562| mu1562_34(int &) = Store[r] : &:r1562_25, r1562_33
# 1563| r1563_1(double) = Constant[4.0] :
# 1563| r1563_2(glval<double &>) = VariableAddress[d] :
# 1563| r1563_3(double &) = Load[d] : &:r1563_2, ~m?
# 1563| r1563_4(glval<double>) = CopyValue : r1563_3
# 1563| mu1563_5(double) = Store[?] : &:r1563_4, r1563_1
# 1564| r1564_1(glval<double &>) = VariableAddress[rd] :
# 1564| r1564_2(glval<double &>) = VariableAddress[d] :
# 1564| r1564_3(double &) = Load[d] : &:r1564_2, ~m?
# 1564| r1564_4(glval<double>) = CopyValue : r1564_3
# 1564| r1564_5(double &) = CopyValue : r1564_4
# 1564| mu1564_6(double &) = Store[rd] : &:r1564_1, r1564_5
# 1565| r1565_1(glval<int>) = VariableAddress[v] :
# 1565| r1565_2(glval<int &>) = VariableAddress[i] :
# 1565| r1565_3(int &) = Load[i] : &:r1565_2, ~m?
# 1565| r1565_4(int) = Load[?] : &:r1565_3, ~m?
# 1565| mu1565_5(int) = Store[v] : &:r1565_1, r1565_4
# 1566| r1566_1(int) = Constant[5] :
# 1566| r1566_2(glval<int &>) = VariableAddress[r] :
# 1566| r1566_3(int &) = Load[r] : &:r1566_2, ~m?
# 1566| r1566_4(glval<int>) = CopyValue : r1566_3
# 1566| mu1566_5(int) = Store[?] : &:r1566_4, r1566_1
# 1567| r1567_1(glval<int &>) = VariableAddress[rr] :
# 1567| r1567_2(glval<int &>) = VariableAddress[r] :
# 1567| r1567_3(int &) = Load[r] : &:r1567_2, ~m?
# 1567| r1567_4(glval<int>) = CopyValue : r1567_3
# 1567| r1567_5(int &) = CopyValue : r1567_4
# 1567| mu1567_6(int &) = Store[rr] : &:r1567_1, r1567_5
# 1568| r1568_1(glval<int>) = VariableAddress[w] :
# 1568| r1568_2(glval<int &>) = VariableAddress[r] :
# 1568| r1568_3(int &) = Load[r] : &:r1568_2, ~m?
# 1568| r1568_4(int) = Load[?] : &:r1568_3, ~m?
# 1568| mu1568_5(int) = Store[w] : &:r1568_1, r1568_4
# 1572| r1572_1(glval<StructuredBindingTuple>) = VariableAddress[unnamed_local_variable] :
# 1572| r1572_2(glval<StructuredBindingTuple>) = VariableAddress[t] :
# 1572| r1572_3(StructuredBindingTuple) = Load[t] : &:r1572_2, ~m?
# 1572| mu1572_4(StructuredBindingTuple) = Store[unnamed_local_variable] : &:r1572_1, r1572_3
# 1573| r1573_1(glval<int &>) = VariableAddress[i] :
# 1573| r1573_2(glval<StructuredBindingTuple>) = VariableAddress[unnamed_local_variable] :
# 1573| r1573_3(glval<unknown>) = FunctionAddress[get] :
# 1573| r1573_4(int &) = Call[get] : func:r1573_3, this:r1573_2
# 1573| mu1573_5(unknown) = ^CallSideEffect : ~m?
# 1573| v1573_6(void) = ^IndirectReadSideEffect[-1] : &:r1573_2, ~m?
# 1573| mu1573_7(StructuredBindingTuple) = ^IndirectMayWriteSideEffect[-1] : &:r1573_2
# 1573| r1573_8(glval<int>) = CopyValue : r1573_4
# 1573| r1573_9(int &) = CopyValue : r1573_8
# 1573| mu1573_10(int &) = Store[i] : &:r1573_1, r1573_9
# 1574| r1574_1(glval<double &>) = VariableAddress[d] :
# 1574| r1574_2(glval<StructuredBindingTuple>) = VariableAddress[unnamed_local_variable] :
# 1574| r1574_3(glval<unknown>) = FunctionAddress[get] :
# 1574| r1574_4(double &) = Call[get] : func:r1574_3, this:r1574_2
# 1574| mu1574_5(unknown) = ^CallSideEffect : ~m?
# 1574| v1574_6(void) = ^IndirectReadSideEffect[-1] : &:r1574_2, ~m?
# 1574| mu1574_7(StructuredBindingTuple) = ^IndirectMayWriteSideEffect[-1] : &:r1574_2
# 1574| r1574_8(glval<double>) = CopyValue : r1574_4
# 1574| r1574_9(double &) = CopyValue : r1574_8
# 1574| mu1574_10(double &) = Store[d] : &:r1574_1, r1574_9
# 1575| r1575_1(glval<int &>) = VariableAddress[r] :
# 1575| r1575_2(glval<StructuredBindingTuple>) = VariableAddress[unnamed_local_variable] :
# 1575| r1575_3(glval<unknown>) = FunctionAddress[get] :
# 1575| r1575_4(int &) = Call[get] : func:r1575_3, this:r1575_2
# 1575| mu1575_5(unknown) = ^CallSideEffect : ~m?
# 1575| v1575_6(void) = ^IndirectReadSideEffect[-1] : &:r1575_2, ~m?
# 1575| mu1575_7(StructuredBindingTuple) = ^IndirectMayWriteSideEffect[-1] : &:r1575_2
# 1575| r1575_8(glval<int>) = CopyValue : r1575_4
# 1575| r1575_9(int &) = CopyValue : r1575_8
# 1575| mu1575_10(int &) = Store[r] : &:r1575_1, r1575_9
# 1576| r1576_1(double) = Constant[4.0] :
# 1576| r1576_2(glval<double &>) = VariableAddress[d] :
# 1576| r1576_3(double &) = Load[d] : &:r1576_2, ~m?
# 1576| r1576_4(glval<double>) = CopyValue : r1576_3
# 1576| mu1576_5(double) = Store[?] : &:r1576_4, r1576_1
# 1577| r1577_1(glval<double &>) = VariableAddress[rd] :
# 1577| r1577_2(glval<double &>) = VariableAddress[d] :
# 1577| r1577_3(double &) = Load[d] : &:r1577_2, ~m?
# 1577| r1577_4(glval<double>) = CopyValue : r1577_3
# 1577| r1577_5(double &) = CopyValue : r1577_4
# 1577| mu1577_6(double &) = Store[rd] : &:r1577_1, r1577_5
# 1578| r1578_1(glval<int>) = VariableAddress[v] :
# 1578| r1578_2(glval<int &>) = VariableAddress[i] :
# 1578| r1578_3(int &) = Load[i] : &:r1578_2, ~m?
# 1578| r1578_4(int) = Load[?] : &:r1578_3, ~m?
# 1578| mu1578_5(int) = Store[v] : &:r1578_1, r1578_4
# 1579| r1579_1(int) = Constant[5] :
# 1579| r1579_2(glval<int &>) = VariableAddress[r] :
# 1579| r1579_3(int &) = Load[r] : &:r1579_2, ~m?
# 1579| r1579_4(glval<int>) = CopyValue : r1579_3
# 1579| mu1579_5(int) = Store[?] : &:r1579_4, r1579_1
# 1580| r1580_1(glval<int &>) = VariableAddress[rr] :
# 1580| r1580_2(glval<int &>) = VariableAddress[r] :
# 1580| r1580_3(int &) = Load[r] : &:r1580_2, ~m?
# 1580| r1580_4(glval<int>) = CopyValue : r1580_3
# 1580| r1580_5(int &) = CopyValue : r1580_4
# 1580| mu1580_6(int &) = Store[rr] : &:r1580_1, r1580_5
# 1581| r1581_1(glval<int>) = VariableAddress[w] :
# 1581| r1581_2(glval<int &>) = VariableAddress[r] :
# 1581| r1581_3(int &) = Load[r] : &:r1581_2, ~m?
# 1581| r1581_4(int) = Load[?] : &:r1581_3, ~m?
# 1581| mu1581_5(int) = Store[w] : &:r1581_1, r1581_4
# 1583| v1583_1(void) = NoOp :
# 1558| v1558_4(void) = ReturnVoid :
# 1558| v1558_5(void) = AliasedUse : ~m?
# 1558| v1558_6(void) = ExitFunction :
perf-regression.cpp:
# 6| void Big::Big()
# 6| Block 0

View File

@@ -1,2 +1,3 @@
| hiding.cpp:6:17:6:17 | i | Variable i hides another variable of the same name (on $@). | hiding.cpp:4:13:4:13 | i | line 4 |
| hiding.cpp:18:15:18:15 | k | Variable k hides another variable of the same name (on $@). | hiding.cpp:15:11:15:11 | k | line 15 |
| hiding.cpp:38:11:38:11 | x | Variable x hides another variable of the same name (on $@). | hiding.cpp:36:9:36:9 | x | line 36 |

View File

@@ -35,7 +35,7 @@ void structuredBinding() {
int xs[1] = {1};
auto [x] = xs;
{
auto [x] = xs; // BAD [NOT DETECTED]
auto [x] = xs; // BAD
auto [y] = xs; // GOOD
}
}

View File

@@ -99,19 +99,19 @@ void positiveTestCases()
void* h = 0;
wchar_t* lpApplicationName = NULL;
// CreatePorcessA
// CreateProcessA
CreateProcessA( //BUG
NULL,
(char*)"C:\\Program Files\\MyApp",
NULL, NULL, FALSE, 0, NULL, NULL, NULL, NULL);
// CreatePorcessW
// CreateProcessW
CreateProcessW( //BUG
NULL,
(wchar_t*)L"C:\\Program Files\\MyApp",
NULL, NULL, FALSE, 0, NULL, NULL, NULL, NULL);
// CreatePorcess
// CreateProcess
CreateProcess( //BUG
NULL,
(wchar_t*)L"C:\\Program Files\\MyApp",
@@ -162,7 +162,7 @@ void positiveTestCases()
(wchar_t*)L"C:\\Program Files\\MyApp",
NULL, NULL, FALSE, 0, NULL, NULL, NULL, NULL);
// CreatePorcess with a hardcoded variable for application Name (NULL)
// CreateProcess with a hardcoded variable for application Name (NULL)
// Variation: tab instead of space
CreateProcess( //BUG
lpApplicationName,
@@ -276,19 +276,19 @@ void negativeTestCases_quotedCommandLine()
void* h = 0;
wchar_t* lpApplicationName = NULL;
// CreatePorcessA
// CreateProcessA
CreateProcessA(
NULL,
(char*)"\"C:\\Program Files\\MyApp\"",
NULL, NULL, FALSE, 0, NULL, NULL, NULL, NULL);
// CreatePorcessW
// CreateProcessW
CreateProcessW(
NULL,
(wchar_t*)L"\"C:\\Program Files\\MyApp\"",
NULL, NULL, FALSE, 0, NULL, NULL, NULL, NULL);
// CreatePorcess
// CreateProcess
CreateProcess(
NULL,
(wchar_t*)L"\"C:\\Program Files\\MyApp\"",
@@ -339,7 +339,7 @@ void negativeTestCases_quotedCommandLine()
(wchar_t*)L"\"C:\\Program Files\\MyApp\"",
NULL, NULL, FALSE, 0, NULL, NULL, NULL, NULL);
// CreatePorcess with a hardcoded variable for application Name (NULL)
// CreateProcess with a hardcoded variable for application Name (NULL)
CreateProcess(
lpApplicationName,
(wchar_t*)L"\"C:\\Program Files\\MyApp\"",
@@ -359,19 +359,19 @@ void negativeTestCases_AppNameSet()
void* h = 0;
const wchar_t* lpApplicationName = (const wchar_t*)L"MyApp.exe";
// CreatePorcessA
// CreateProcessA
CreateProcessA(
(char*)"MyApp.exe",
(char*)"C:\\Program Files\\MyApp",
NULL, NULL, FALSE, 0, NULL, NULL, NULL, NULL);
// CreatePorcessW
// CreateProcessW
CreateProcessW(
(wchar_t*)L"MyApp.exe",
(wchar_t*)L"C:\\Program Files\\MyApp",
NULL, NULL, FALSE, 0, NULL, NULL, NULL, NULL);
// CreatePorcess
// CreateProcess
CreateProcess(
(wchar_t*)L"MyApp.exe",
(wchar_t*)L"C:\\Program Files\\MyApp",
@@ -422,7 +422,7 @@ void negativeTestCases_AppNameSet()
(wchar_t*)L"C:\\Program Files\\MyApp",
NULL, NULL, FALSE, 0, NULL, NULL, NULL, NULL);
// CreatePorcess with a hardcoded variable for application Name (NULL)
// CreateProcess with a hardcoded variable for application Name (NULL)
CreateProcess(
(wchar_t*)lpApplicationName,
(wchar_t*)L"C:\\Program Files\\MyApp",

View File

@@ -0,0 +1,29 @@
typedef unsigned int mode_t;
#define O_RDWR 0x0002
#define O_CLOEXEC 0x0040
#define O_NONBLOCK 0x0080
#define O_CREAT 0x0200
#define O_APPEND 0x0800
#define O_TMPFILE 0x2000
int open(const char *pathname, int flags, ...);
int openat(int dirfd, const char *pathname, int flags, ...);
const char *a_file = "/a_file";
void test_open() {
open(a_file, O_NONBLOCK); // GOOD
open(a_file, O_RDWR | O_CLOEXEC); // GOOD
open(a_file, O_APPEND); // GOOD
open(a_file, O_CREAT); // BAD
open(a_file, O_CREAT, 0); // GOOD
open(a_file, O_TMPFILE); // BAD
open(a_file, O_TMPFILE, 0); // GOOD
openat(0, a_file, O_APPEND); // GOOD
openat(0, a_file, O_CREAT); // BAD
openat(0, a_file, O_CREAT, 0); // GOOD
openat(0, a_file, O_TMPFILE); // BAD
openat(0, a_file, O_TMPFILE, 0); // GOOD
}

View File

@@ -0,0 +1,4 @@
| OpenCallMissingModeArgument.c:20:3:20:6 | call to open | A file is created here without providing a mode argument, which may leak bits from the stack. |
| OpenCallMissingModeArgument.c:22:3:22:6 | call to open | A file is created here without providing a mode argument, which may leak bits from the stack. |
| OpenCallMissingModeArgument.c:25:3:25:8 | call to openat | A file is created here without providing a mode argument, which may leak bits from the stack. |
| OpenCallMissingModeArgument.c:27:3:27:8 | call to openat | A file is created here without providing a mode argument, which may leak bits from the stack. |

View File

@@ -0,0 +1 @@
Security/CWE/CWE-732/OpenCallMissingModeArgument.ql

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
description: Remove 'lambda_expr_return_type' relation.
compatibility: backwards
lambda_expr_return_type.rel: delete

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
description: Add externalData relation
compatibility: full
externalData.rel: delete

View File

@@ -22,12 +22,13 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
Parameter.Create(Context, symbol, this);
}
private Lambda(ExpressionNodeInfo info, CSharpSyntaxNode body, IEnumerable<ParameterSyntax> @params)
private Lambda(ExpressionNodeInfo info, CSharpSyntaxNode body, IEnumerable<ParameterSyntax> @params, TypeSyntax? @return)
: base(info)
{
if (Context.GetModel(info.Node).GetSymbolInfo(info.Node).Symbol is IMethodSymbol symbol)
{
Modifier.ExtractModifiers(Context, info.Context.TrapWriter.Writer, this, symbol);
Attribute.ExtractAttributes(Context, symbol, this);
}
else
{
@@ -40,6 +41,13 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
foreach (var param in @params)
VisitParameter(param);
if (@return is not null)
{
var symbol = Context.GetType(@return);
var type = Entities.Type.Create(Context, symbol);
var trapFile = Context.TrapWriter.Writer;
trapFile.lambda_expr_return_type(this, type.TypeRef);
}
if (body is ExpressionSyntax exprBody)
Create(Context, exprBody, this, 0);
else if (body is BlockSyntax blockBody)
@@ -50,17 +58,17 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
}
private Lambda(ExpressionNodeInfo info, ParenthesizedLambdaExpressionSyntax node)
: this(info.SetKind(ExprKind.LAMBDA), node.Body, node.ParameterList.Parameters) { }
: this(info.SetKind(ExprKind.LAMBDA), node.Body, node.ParameterList.Parameters, node.ReturnType) { }
public static Lambda Create(ExpressionNodeInfo info, ParenthesizedLambdaExpressionSyntax node) => new Lambda(info, node);
private Lambda(ExpressionNodeInfo info, SimpleLambdaExpressionSyntax node)
: this(info.SetKind(ExprKind.LAMBDA), node.Body, Enumerators.Singleton(node.Parameter)) { }
: this(info.SetKind(ExprKind.LAMBDA), node.Body, Enumerators.Singleton(node.Parameter), null) { }
public static Lambda Create(ExpressionNodeInfo info, SimpleLambdaExpressionSyntax node) => new Lambda(info, node);
private Lambda(ExpressionNodeInfo info, AnonymousMethodExpressionSyntax node) :
this(info.SetKind(ExprKind.ANONYMOUS_METHOD), node.Body, node.ParameterList is null ? Enumerable.Empty<ParameterSyntax>() : node.ParameterList.Parameters)
this(info.SetKind(ExprKind.ANONYMOUS_METHOD), node.Body, node.ParameterList is null ? Enumerable.Empty<ParameterSyntax>() : node.ParameterList.Parameters, null)
{ }
public static Lambda Create(ExpressionNodeInfo info, AnonymousMethodExpressionSyntax node) => new Lambda(info, node);

View File

@@ -215,6 +215,9 @@ namespace Semmle.Extraction.CSharp
internal static void indexers(this TextWriter trapFile, Indexer propKey, string name, Type declaringType, Type memberType, Indexer unboundProperty) =>
trapFile.WriteTuple("indexers", propKey, name, declaringType, memberType, unboundProperty);
internal static void lambda_expr_return_type(this TextWriter trapFile, Lambda expr, Type returnType) =>
trapFile.WriteTuple("lambda_expr_return_type", expr, returnType);
internal static void local_function_stmts(this TextWriter trapFile, Entities.Statements.LocalFunction fnStmt, LocalFunction fn) =>
trapFile.WriteTuple("local_function_stmts", fnStmt, fn);

View File

@@ -52,7 +52,7 @@ namespace Semmle.Extraction
/// <summary>
/// The compression algorithm used for trap files.
/// </summary>
public TrapWriter.CompressionMode TrapCompression { get; set; } = TrapWriter.CompressionMode.Gzip;
public TrapWriter.CompressionMode TrapCompression { get; set; } = TrapWriter.CompressionMode.Brotli;
public virtual bool HandleOption(string key, string value)
{

View File

@@ -1 +1,9 @@
## 1.0.4
## 1.0.3
## 1.0.2
## 1.0.0
## 0.0.6

View File

@@ -0,0 +1 @@
## 1.0.2

View File

@@ -0,0 +1 @@
## 1.0.3

View File

@@ -0,0 +1 @@
## 1.0.4

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.0.1
lastReleaseVersion: 1.0.4

View File

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

View File

@@ -1 +1,9 @@
## 1.0.4
## 1.0.3
## 1.0.2
## 1.0.0
## 0.0.6

View File

@@ -0,0 +1 @@
## 1.0.2

View File

@@ -0,0 +1 @@
## 1.0.3

View File

@@ -0,0 +1 @@
## 1.0.4

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.0.1
lastReleaseVersion: 1.0.4

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