C#: Add extractor and QL library support for ref readonly parameters.

This commit is contained in:
Michael Nebel
2024-02-26 11:08:59 +01:00
parent a86de9de2f
commit 692d7036a0
3 changed files with 22 additions and 1 deletions

View File

@@ -167,6 +167,18 @@ class Parameter extends DotNet::Parameter, LocalScopeVariable, Attributable, Top
*/
predicate isParams() { params(this, _, _, _, 3, _, _) }
/**
* Holds if this parameter if a ref readonly parameter.
* For example, `p` is a ref readonly parameter in
*
* ```csharp
* void M(ref readonly int p) {
* ...
* }
* ```
*/
predicate isReadonlyRef() { params(this, _, _, _, 6, _, _) }
/**
* Holds this parameter is the first parameter of an extension method.
* For example, `list` is the first parameter of the extension method