Commit Graph

926 Commits

Author SHA1 Message Date
Geoffrey White
f3501819f7 Merge branch 'main' into nth 2025-02-07 18:13:18 +00:00
Geoffrey White
b5c07540d0 Merge pull request #18621 from geoffw0/sourcemodels4
Rust: Improve models for environment sources, iterators
2025-02-07 16:02:28 +00:00
Simon Friis Vindum
11055760a4 Rust: Handle writes to references and add encoding of reference content 2025-02-07 13:53:17 +01:00
Mathew Payne
6e5899b4ff Merge branch 'main' into rust-rusqlite 2025-02-07 10:51:02 +00:00
Mathew Payne
5c656412d1 Update rust/ql/lib/codeql/rust/frameworks/tokio-postgres.model.yml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-02-07 10:33:29 +00:00
GeekMasher
5943cc16e4 feat(rust): Add Database Sources + tokio-postgres support 2025-02-07 10:26:40 +00:00
Tom Hvitved
d8c9427d3e Merge pull request #18700 from hvitved/rust/shorthand-struct
Rust: Shorthand record construction in data flow
2025-02-07 10:59:52 +01:00
Tom Hvitved
100de73066 Merge pull request #18689 from hvitved/rust/path-resolution-type-param
Rust: Extend path resolution to cover type parameters
2025-02-07 08:55:27 +01:00
Simon Friis Vindum
9bcfd010d4 Merge pull request #18676 from paldepind/rust-model-clone
Rust: Model `clone`
2025-02-07 08:37:44 +01:00
Tom Hvitved
707bf16d90 Rust: Shorthand record construction in data flow 2025-02-06 19:19:18 +01:00
Tom Hvitved
aca70cd1ea Merge pull request #18675 from hvitved/rust/struct-tuple-field
Rust: Implement data flow through tuple structs
2025-02-06 19:17:53 +01:00
Simon Friis Vindum
b2ba5f4f38 Rust: Make imports private 2025-02-06 16:07:25 +01:00
Geoffrey White
a8a051234e Rust: Model parse. 2025-02-06 12:51:41 +00:00
Geoffrey White
d0f5aad085 Rust: Model to_string. 2025-02-06 12:51:40 +00:00
Simon Friis Vindum
820d2cbeb8 Shared: Use edge dominance in basic block library 2025-02-06 10:38:32 +01:00
Paolo Tranquilli
d65a704209 Merge pull request #18635 from hvitved/codegen/self-type-alias
Codegen: Improve return type of self-typed properties
2025-02-05 17:20:25 +01:00
Tom Hvitved
493953e724 Rust: Extend path resolution to cover type parameters 2025-02-05 15:30:07 +01:00
Tom Hvitved
e4d9e29368 Rust: Implement data flow through tuple structs 2025-02-05 13:27:07 +01:00
Simon Friis Vindum
6e99087b40 Rust: Basic support for futures and await 2025-02-05 13:22:57 +01:00
Geoffrey White
70d969f3a0 Merge branch 'main' into http 2025-02-05 09:36:43 +00:00
Simon Friis Vindum
86d7feabc6 Rust: Add value flow model for clone methods 2025-02-05 09:18:58 +01:00
Simon Friis Vindum
670ecb3298 Merge pull request #18673 from paldepind/rust-higher-order-function-model-generation
Rust: Higher order function model generation
2025-02-05 09:15:46 +01:00
Geoffrey White
0cdef97276 Merge branch 'main' into sourcemodels4 2025-02-04 14:30:37 +00:00
Tom Hvitved
f1140530c0 Merge pull request #18656 from hvitved/rust/record-destruct-shorthand
Rust: Shorthand record pattern destructuring in data flow
2025-02-04 15:25:12 +01:00
Simon Friis Vindum
ece5557f3d Apply suggestions from code review
Co-authored-by: Tom Hvitved <hvitved@github.com>
2025-02-04 15:10:32 +01:00
Arthur Baars
2a32e8865d Merge pull request #18668 from github/post-release-prep/codeql-cli-2.20.4
Post-release preparation for codeql-cli-2.20.4
2025-02-04 14:22:53 +01:00
Simon Friis Vindum
b0a3cdc68c Rust: Generate flow summaries for higher-order functions 2025-02-04 14:03:19 +01:00
Geoffrey White
ff53d422cb Rust: Model some sources in hyper. 2025-02-04 10:28:05 +00:00
Simon Friis Vindum
cf4f6575d1 Merge branch 'main' into rust-flow-summary-generation 2025-02-04 10:42:11 +01:00
github-actions[bot]
f1b05a79a4 Post-release preparation for codeql-cli-2.20.4 2025-02-04 09:25:09 +00:00
Simon Friis Vindum
07413315a1 Rust: Address PR comments 2025-02-04 10:19:04 +01:00
Tom Hvitved
90944d5252 Merge pull request #18609 from hvitved/rust/dataflow-path-resolution
Rust: Use `PathResolution` module in data flow
2025-02-04 10:11:54 +01:00
Simon Friis Vindum
fc15c0d3b2 Merge branch 'main' into rust-flow-summary-generation 2025-02-04 10:10:33 +01:00
Tom Hvitved
acd31dd701 Merge pull request #18657 from hvitved/rust/dataflow-node-api
Rust: Hide internal implementation details from `DataFlow::Node`
2025-02-04 09:41:44 +01:00
Tom Hvitved
5a24440e59 Update rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll
Co-authored-by: Simon Friis Vindum <paldepind@github.com>
2025-02-04 09:38:16 +01:00
github-actions[bot]
573e53e454 Release preparation for version 2.20.4 2025-02-03 15:19:35 +00:00
Tom Hvitved
45fc1daa74 Rust: Hide internal implementation details from DataFlow::Node 2025-02-03 14:12:56 +01:00
Tom Hvitved
f1050c4988 Rust: Shorthand record pattern destructuring in data flow 2025-02-03 13:00:52 +01:00
Tom Hvitved
4923156d0d Address review comments 2025-02-03 12:52:31 +01:00
Tom Hvitved
3d3b785400 Rust: Remove redundant infix casts 2025-02-03 09:12:09 +01:00
Tom Hvitved
ebe2084507 Rust: Run codegen 2025-02-03 09:11:10 +01:00
Simon Friis Vindum
0a9b864738 Rust: Fix model generation test 2025-02-03 09:06:07 +01:00
Tom Hvitved
cd1ff6a176 Rust: Fix a bad join
Before
```
[2025-01-31 14:40:10] Evaluated non-recursive predicate SsaImpl::capturedCallRead/4#1f9b0af4@6f60dcog in 10553ms (size: 372366).
Evaluated relational algebra for predicate SsaImpl::capturedCallRead/4#1f9b0af4@6f60dcog with tuple counts:
        1992868487   ~4%    {6} r1 = JOIN `_BasicBlock::Make<Locations::Location,BasicBlocks::BasicBlocksImpl::BasicBlockInputSig>::Cached::get__#shared` WITH `SsaImpl::variableWriteInOuterScope/4#aca2ef34` ON FIRST 1 OUTPUT Lhs.1, Lhs.0, Lhs.2, Rhs.1, Rhs.2, Rhs.3
                            {6}    | REWRITE WITH TEST InOut.3 < InOut.2
         998449075   ~0%    {5}    | SCAN OUTPUT In.4, In.5, In.0, In.1, In.2

          12205909   ~1%    {4} r2 = JOIN `_BasicBlock::Make<Locations::Location,BasicBlocks::BasicBlocksImpl::BasicBlockInputSig>::Cached::get__#shared` WITH `boundedFastTC:BasicBlocks::BasicBlock.getAPredecessor/0#dispred#268ed41b:_BasicBlock::Make<Locations::Location,BasicBlocks::BasicBlocksImpl::BasicBlockInputSig>::Cached::get__#higher_order_body` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.0, Lhs.2
          34440992   ~9%    {5}    | JOIN WITH `project#SsaImpl::variableWriteInOuterScope/4#aca2ef34` ON FIRST 1 OUTPUT Rhs.1, Rhs.2, Lhs.1, Lhs.2, Lhs.3

        1032890067   ~0%    {5} r3 = r1 UNION r2
            680217  ~74%    {4}    | JOIN WITH `SsaImpl::hasCapturedRead/2#847e9f91` ON FIRST 2 OUTPUT Lhs.2, Lhs.3, Lhs.4, Lhs.0
                            return r3
```

After
```
[2025-01-31 14:43:05] Evaluated non-recursive predicate SsaImpl::capturedCallRead/4#1f9b0af4@15fdf34h in 74ms (size: 373835).
Evaluated relational algebra for predicate SsaImpl::capturedCallRead/4#1f9b0af4@15fdf34h with tuple counts:
        1106129   ~0%    {3} r1 = SCAN `project#SsaImpl::variableWriteInOuterScope/4#aca2ef34` OUTPUT In.1, In.2, In.0
          25209  ~20%    {2}    | JOIN WITH `SsaImpl::hasCapturedRead/2#847e9f91` ON FIRST 2 OUTPUT Lhs.2, Lhs.0
         339364   ~6%    {2}    | JOIN WITH `boundedFastTC:BasicBlocks::BasicBlock.getAPredecessor/0#dispred#268ed41b_10#higher_order_body:_SsaImpl::hasCapturedRead/2#847e9f91_project#SsaImpl::variableWriteInOuterScope/4#aca2ef34#higher_order_body` ON FIRST 1 OUTPUT Rhs.1, Lhs.1
        2095088   ~0%    {4}    | JOIN WITH `BasicBlock::Make<Locations::Location,BasicBlocks::BasicBlocksImpl::BasicBlockInputSig>::Cached::getNode/2#4226f9fe` ON FIRST 1 OUTPUT Lhs.0, Rhs.1, Rhs.2, Lhs.1

        1121531   ~0%    {4} r2 = SCAN `SsaImpl::variableWriteInOuterScope/4#aca2ef34` OUTPUT In.2, In.3, In.0, In.1
          25820  ~22%    {3}    | JOIN WITH `SsaImpl::hasCapturedRead/2#847e9f91` ON FIRST 2 OUTPUT Lhs.2, Lhs.0, Lhs.3
         505208   ~1%    {5}    | JOIN WITH `BasicBlock::Make<Locations::Location,BasicBlocks::BasicBlocksImpl::BasicBlockInputSig>::Cached::getNode/2#4226f9fe` ON FIRST 1 OUTPUT Lhs.1, Lhs.0, Lhs.2, Rhs.1, Rhs.2
                         {5}    | REWRITE WITH TEST InOut.2 < InOut.3
         344294   ~6%    {4}    | SCAN OUTPUT In.1, In.3, In.4, In.0

        2439382   ~0%    {4} r3 = r1 UNION r2
        2434485   ~7%    {4}    | JOIN WITH `BasicBlock::Make<Locations::Location,BasicBlocks::BasicBlocksImpl::BasicBlockInputSig>::Cached::getNode/2#4226f9fe` ON FIRST 3 OUTPUT Lhs.2, Lhs.3, Lhs.0, Lhs.1
        2393182   ~3%    {4}    | JOIN WITH ControlFlowGraphImpl::CfgImpl::Cached::TAstNode#8f9a3aff_31#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3
         380879   ~0%    {4}    | JOIN WITH `SsaImpl::isControlFlowJump/1#c535656e` ON FIRST 1 OUTPUT Lhs.0, Lhs.2, Lhs.3, Lhs.1
                         return r3
```
2025-01-31 14:45:36 +01:00
Tom Hvitved
d56bf657b9 Rust: Use PathResolution module in data flow 2025-01-31 13:29:15 +01:00
Tom Hvitved
1cb524f76f Rust: Remove useTreeIsGlobImport workaround 2025-01-31 10:10:58 +01:00
Tom Hvitved
9d06f80902 Rust: Elaborate QL doc on PathResolution.qll 2025-01-31 10:10:57 +01:00
Tom Hvitved
8eb5792f3b Address review comments 2025-01-31 10:10:55 +01:00
Tom Hvitved
0aee2e6fb2 Rust: Implement path resolution in QL 2025-01-31 10:07:08 +01:00
Simon Friis Vindum
f76647fc00 Rust: Initial model generation setup 2025-01-30 11:45:21 +01:00
Arthur Baars
54efb0a4a6 Merge pull request #18611 from github/aibaars/use-tree-star
Rust: add UseTree::is_star
2025-01-29 14:42:03 +01:00