mirror of
https://github.com/github/codeql.git
synced 2026-04-22 23:35:14 +02:00
C#: Add test for length argument of implicitly sized arrays
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
| expressions.cs:168:27:168:44 | array creation of type Object[] | expressions.cs:168:27:168:44 | 1 | false |
|
||||
| expressions.cs:409:23:409:65 | array creation of type Int32[,] | expressions.cs:409:23:409:65 | 3 | false |
|
||||
| expressions.cs:409:23:409:65 | array creation of type Int32[,] | expressions.cs:409:23:409:65 | 3 | false |
|
||||
13
csharp/ql/test/library-tests/expressions/ArrayCreation11.ql
Normal file
13
csharp/ql/test/library-tests/expressions/ArrayCreation11.ql
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @name Test for array creations
|
||||
*/
|
||||
|
||||
import csharp
|
||||
|
||||
private boolean isImplicit(Expr expr) {
|
||||
if expr.isImplicit() then result = true else result = false
|
||||
}
|
||||
|
||||
from ArrayCreation ac, Expr expr
|
||||
where ac.isImplicitlySized() and not ac.isImplicitlyTyped() and expr = ac.getALengthArgument()
|
||||
select ac, expr, isImplicit(expr)
|
||||
Reference in New Issue
Block a user