Commit Graph

1765 Commits

Author SHA1 Message Date
Tom Hvitved
f1bff93bc5 Merge pull request #20203 from hvitved/rust/if-let-chain-test
Rust: Handle chained `let` expressions
2025-08-14 19:51:43 +02:00
Paolo Tranquilli
6ca1c587f6 Merge branch 'main' into redsun82/cargo-upgrade-2 2025-08-14 17:55:17 +02:00
copilot-swe-agent[bot]
7b1aa2307f Address PR feedback: trim examples, remove duplicate CWE ref, autoformat
Co-authored-by: geoffw0 <40627776+geoffw0@users.noreply.github.com>
2025-08-14 13:15:03 +00:00
Tom Hvitved
d09645bc96 Add change note 2025-08-14 14:38:44 +02:00
Tom Hvitved
51fb2157ef Rust: Remove references to getResolvedPath and getExtendedCanonicalPath 2025-08-14 11:31:42 +02:00
Tom Hvitved
f63e55c1fd Rust: Handle chained let expressions 2025-08-14 10:36:43 +02:00
copilot-swe-agent[bot]
39ea50746f Implement Rust log injection query and test infrastructure
Co-authored-by: geoffw0 <40627776+geoffw0@users.noreply.github.com>
2025-08-13 18:09:03 +00:00
Tom Hvitved
dc6e76a0d7 Merge pull request #20182 from hvitved/rust/type-inference-tuple-types-follow-up
Rust: Unify type inference for tuple indexing expressions
2025-08-13 13:32:53 +02:00
Geoffrey White
17b468239b Merge pull request #20208 from geoffw0/sqlmodels
Rust: Fill some gaps in our database models.
2025-08-13 08:54:23 +01:00
Paolo Tranquilli
92e94695e7 Rust: add ForBinder case in ClosureExpr and accept test changes 2025-08-12 17:29:11 +02:00
Paolo Tranquilli
338572f256 Rust: run codegen again 2025-08-12 17:04:26 +02:00
Paolo Tranquilli
a007230f21 Merge branch 'main' into redsun82/cargo-upgrade-2 2025-08-12 16:42:23 +02:00
Tom Hvitved
454ab4db8c Rust: Unify type inference for tuple indexing expressions 2025-08-12 10:32:23 +02:00
Tom Hvitved
8436f00b23 Merge pull request #20179 from hvitved/rust/type-inference-certain-follow-up
Rust: Generalize certain type inference logic
2025-08-12 10:30:02 +02:00
Geoffrey White
993f00b658 Rust: Change note. 2025-08-11 19:32:13 +01:00
Geoffrey White
398d2ac930 Rust: Fix a couple more gaps. 2025-08-11 19:24:54 +01:00
Geoffrey White
0544ea8728 Rust: Add postgres sources. 2025-08-11 18:43:11 +01:00
Geoffrey White
4bbffc56a8 Rust: Expand tokio-postgres sources. 2025-08-11 18:42:44 +01:00
Geoffrey White
35681d0617 Rust: Add SQLx sources. 2025-08-11 18:05:58 +01:00
Geoffrey White
5056ebf186 Rust: Fix typo in one of the models. 2025-08-11 18:05:42 +01:00
Geoffrey White
17741af88e Rust: Fill out a few gaps in the models. 2025-08-11 17:45:51 +01:00
Tom Hvitved
9905cd6436 Merge pull request #20192 from hvitved/rust/path-resolution-remove-source-lib-dedup
Rust: Remove source/library deduplication in path resolution
2025-08-11 13:40:34 +02:00
Tom Hvitved
c043e30d46 Rust: Remove source/library deduplication in path resolution 2025-08-08 13:28:18 +02:00
Tom Hvitved
1be542ec56 Rust: Generalize certain type inference logic 2025-08-07 10:37:17 +02:00
Geoffrey White
aafdf1a279 Rust: Update StreamCipherInit to use getCanonicalPath. 2025-08-07 09:27:51 +01:00
Geoffrey White
e991aa3253 Merge branch 'main' into cleartextstorage 2025-08-06 15:49:44 +01:00
Tom Hvitved
ed3a33fdc6 Merge pull request #20177 from hvitved/rust/type-inference-where
Rust: Improve handling of where clauses in type inference and path resolution
2025-08-06 15:52:56 +02:00
Geoffrey White
d215ea16da Merge pull request #19802 from geoffw0/sqlx
Rust: Update SqlxQuery, SqlxExecute to use getCanonicalPath
2025-08-06 14:52:03 +01:00
Simon Friis Vindum
b50a76693a Rust: Handle multiple type bounds for the same type parameter in getTypeBound 2025-08-06 11:15:28 +02:00
Simon Friis Vindum
b302f3f98f Rust: Improve handling of where clauses in type inference and path resolution 2025-08-06 11:08:18 +02:00
Tom Hvitved
d201ce1705 Merge pull request #20155 from paldepind/rust/type-inference-certain
Rust: Add predicate for certain type information
2025-08-06 10:55:34 +02:00
Tom Hvitved
1f15fc8a35 Merge pull request #20173 from hvitved/rust/type-mention-remove-restriction
Rust: Remove restriction in `PathTypeMention`
2025-08-06 10:13:23 +02:00
Geoffrey White
0d4f8765a6 Merge pull request #20167 from geoffw0/mdlcleanup
Rust: Clean up some odds and ends
2025-08-05 19:25:46 +01:00
Tom Hvitved
a396f9345e Rust: Remove restriction in PathTypeMention 2025-08-05 15:05:43 +02:00
Geoffrey White
c8e9ed3eda Merge branch 'main' into cleartextstorage 2025-08-05 12:44:55 +01:00
Paolo Tranquilli
27650267a1 Merge branch 'main' into redsun82/cargo-upgrade-2 2025-08-05 11:18:56 +02:00
Tom Hvitved
b426d84e1c Merge pull request #20164 from hvitved/rust/fix-bad-join
Rust: Fix bad join
2025-08-05 09:55:51 +02:00
Geoffrey White
dcda6db88b Rust: Lets not try to maintain this list. 2025-08-04 19:51:34 +01:00
Geoffrey White
6c024a5f9e Rust: Remove unnecessary pattern matching in cleartext logging query sinks (probably inherited from another query or language where it is used). 2025-08-04 19:28:40 +01:00
github-actions[bot]
fb4b0aac53 Post-release preparation for codeql-cli-2.22.3 2025-08-04 17:18:08 +00:00
github-actions[bot]
fd82aeb1f8 Release preparation for version 2.22.3 2025-08-04 15:47:57 +00:00
Tom Hvitved
651e1624a6 Rust: Fix bad join
```
Evaluated relational algebra for predicate _Crate::Crate.getSourceFile/0#dispred#e7adf9d7_Crate::Generated::Crate.getName/0#dispred#f4d3b3bf_Pa__#join_rhs@5a04a7t0 with tuple counts:
        34471980   ~0%    {3} r1 = JOIN `PathResolution::isSourceFile/1#803de032` WITH `Crate::Crate.getSourceFile/0#dispred#e7adf9d7` CARTESIAN PRODUCT OUTPUT Rhs.0, Lhs.0, Rhs.1
        34471980  ~37%    {4}    | JOIN WITH `Crate::Generated::Crate.getName/0#dispred#f4d3b3bf` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Rhs.1, _
                          {3}    | REWRITE WITH NOT [Tmp.3 := "std", TEST InOut.2 != Tmp.3, Tmp.3 := "core", TEST InOut.2 != Tmp.3] KEEPING 3
           93420  ~91%    {3}    | SCAN OUTPUT In.1, _, In.0
           93420  ~87%    {3}    | REWRITE WITH Out.1 := "prelude"
                          return r1
```
2025-08-04 17:33:26 +02:00
Geoffrey White
e368ee4b1b Rust: Accept that sql-injection sinks are sinks for this query, and that the existing sinks created for this query are also new sql-injection sinks. 2025-08-04 15:23:04 +01:00
Tom Hvitved
125a4b9b10 Rust: Fix two bad joins introduced by magic
```
Evaluated relational algebra for predicate TypeInference::closureParameterPath/2#9d0bf423#bbf@ba08cc1s with tuple counts:
           565067    ~172652%    {2} r1 = JOIN `Callable::Callable.getParam/1#dispred#ce0254b3_01#count_range` WITH `Callable::Generated::Callable.getNumberOfParams/0#dispred#abb45996` ON FIRST 1 OUTPUT Rhs.1, Lhs.1
            24684     ~11784%    {3}    | JOIN WITH Type::TTupleTypeParameter#5ca17706 ON FIRST 2 OUTPUT Rhs.2, Lhs.1, Lhs.0
             2970      ~1391%    {3}    | JOIN WITH `TypeInference::TypePath::singleton/1#ee45de3b` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Rhs.1
              664       ~242%    {4}    | JOIN WITH `Stdlib::FnOnceTrait.getTypeParam/0#dispred#93f20bbc` CARTESIAN PRODUCT OUTPUT Rhs.1, Lhs.0, Lhs.1, Lhs.2
              303        ~49%    {4}    | JOIN WITH Type::TDynTraitTypeParameter#e16268df ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3
              198         ~0%    {8}    | JOIN WITH `TypeInference::TypePath::singleton/1#ee45de3b` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, _, _, Rhs.1, Lhs.3, _, _
                                 {4}    | REWRITE WITH Out.2 := (In.4 ++ In.5), Tmp.3 := (In.4 ++ In.5), Tmp.6 := "[0-9]+", Tmp.7 := "", Out.3 := regexpReplaceAll(Tmp.3,Tmp.6,Tmp.7) KEEPING 4
              198         ~0%    {6}    | SCAN OUTPUT In.0, In.1, In.2, _, In.3, _
                                 {4}    | REWRITE WITH Out.3 := length(In.4), Tmp.5 := 10, TEST Out.3 <= Tmp.5 KEEPING 4
              198         ~0%    {3}    | SCAN OUTPUT In.1, In.0, In.2

           877984   ~1444714%    {1} r2 = SCAN `CallExprBase::CallExprBase.getArg/1#dispred#d775f13d` OUTPUT In.1
           299888     ~83707%    {3}    | JOIN WITH Type::TTupleTypeParameter#5ca17706_102#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.0, Rhs.2
        515462762     ~59140%    {4}    | JOIN WITH `CallExprBase::Generated::CallExprBase.getNumberOfArgs/0#dispred#0975fe12_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.0, Lhs.2
          9429188  ~25728933%    {3}    | JOIN WITH TypeInference::InvokedClosureExpr#24e5dacb_1#join_rhs ON FIRST 1 OUTPUT Lhs.3, Lhs.1, Lhs.2
            53669    ~142315%    {3}    | JOIN WITH `TypeInference::TypePath::singleton/1#ee45de3b` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Rhs.1
             4003     ~10522%    {4}    | JOIN WITH `Stdlib::FnOnceTrait.getTypeParam/0#dispred#93f20bbc` CARTESIAN PRODUCT OUTPUT Rhs.1, Lhs.0, Lhs.1, Lhs.2
              370       ~910%    {4}    | JOIN WITH Type::TDynTraitTypeParameter#e16268df ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3
              148       ~293%    {8}    | JOIN WITH `TypeInference::TypePath::singleton/1#ee45de3b` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, _, _, Rhs.1, Lhs.3, _, _
                                 {4}    | REWRITE WITH Out.2 := (In.4 ++ In.5), Tmp.3 := (In.4 ++ In.5), Tmp.6 := "[0-9]+", Tmp.7 := "", Out.3 := regexpReplaceAll(Tmp.3,Tmp.6,Tmp.7) KEEPING 4
              148       ~316%    {6}    | SCAN OUTPUT In.0, In.1, In.2, _, In.3, _
                                 {4}    | REWRITE WITH Out.3 := length(In.4), Tmp.5 := 10, TEST Out.3 <= Tmp.5 KEEPING 4
              148       ~293%    {3}    | SCAN OUTPUT In.1, In.0, In.2

              346        ~75%    {3} r3 = r1 UNION r2
                                 return r3
```

and

```
Evaluated relational algebra for predicate TypeInference::fnParameterPath/2#4dea2880#bbf@d56000vi with tuple counts:
                1         ~0%    {1} r1 = SCAN `Stdlib::FnOnceTrait.getTypeParam/0#dispred#93f20bbc` OUTPUT In.1
                1         ~0%    {1}    | JOIN WITH Type::TTypeParamTypeParameter#868c69a5 ON FIRST 1 OUTPUT Rhs.1
                1         ~0%    {1}    | JOIN WITH `TypeInference::TypePath::singleton/1#ee45de3b` ON FIRST 1 OUTPUT Rhs.1
           877984   ~1350201%    {2}    | JOIN WITH `ArgList::Generated::ArgList.getArg/1#dispred#b07adc80` CARTESIAN PRODUCT OUTPUT Rhs.1, Lhs.0
           321252     ~90755%    {4}    | JOIN WITH Type::TTupleTypeParameter#5ca17706_102#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.0, Rhs.2
        553043191     ~65412%    {5}    | JOIN WITH `CallExprBase::Generated::CallExprBase.getNumberOfArgs/0#dispred#0975fe12_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.0, Lhs.3
         10089088  ~26772053%    {4}    | JOIN WITH TypeInference::InvokedClosureExpr#24e5dacb_1#join_rhs ON FIRST 1 OUTPUT Lhs.4, Lhs.1, Lhs.2, Lhs.3
            57729    ~157423%    {8}    | JOIN WITH `TypeInference::TypePath::singleton/1#ee45de3b` ON FIRST 1 OUTPUT Lhs.2, Lhs.3, _, _, Lhs.1, Rhs.1, _, _
                                 {4}    | REWRITE WITH Out.2 := (In.4 ++ In.5), Tmp.3 := (In.4 ++ In.5), Tmp.6 := "[0-9]+", Tmp.7 := "", Out.3 := regexpReplaceAll(Tmp.3,Tmp.6,Tmp.7) KEEPING 4
            57729    ~157423%    {6}    | SCAN OUTPUT In.0, In.1, In.2, _, In.3, _
                                 {4}    | REWRITE WITH Out.3 := length(In.4), Tmp.5 := 10, TEST Out.3 <= Tmp.5 KEEPING 4
            57729    ~157423%    {3}    | SCAN OUTPUT In.1, In.0, In.2
                                 return r1
```
2025-08-04 14:22:50 +02:00
Simon Friis Vindum
3ba285c298 Rust: Implement certain type information for annotation and simple calls 2025-08-04 14:06:38 +02:00
Geoffrey White
01d24c4f83 Merge branch 'main' into sqlx 2025-07-31 16:02:36 +01:00
Simon Friis Vindum
abc58ac8b3 Rust: Add metric and debug predicates for type that reach the length limit 2025-07-31 14:20:32 +02:00
Simon Friis Vindum
3bc1d47738 Merge pull request #20130 from paldepind/rust/type-inference-fn
Rust: Implement type inference for closures and calls to closures
2025-07-30 13:13:57 +02:00
Anders Schack-Mulligen
5ca9c090a8 Merge pull request #20132 from aschackmull/ssa/guardvalue
SSA: Update data flow integration and BarrierGuard interface to use GuardValue.
2025-07-30 12:23:17 +02:00
Geoffrey White
a3110a9091 Rust: Implement query. 2025-07-29 18:19:52 +01:00