mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Fix argument location of top level statement entry point
This commit is contained in:
@@ -112,6 +112,13 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
foreach (var l in symbol.Locations)
|
||||
trapFile.param_location(this, Context.CreateLocation(l));
|
||||
|
||||
if (!symbol.Locations.Any() &&
|
||||
symbol.ContainingSymbol is IMethodSymbol ms &&
|
||||
ms.Name == WellKnownMemberNames.TopLevelStatementsEntryPointMethodName)
|
||||
{
|
||||
trapFile.param_location(this, Context.CreateLocation());
|
||||
}
|
||||
|
||||
if (!IsSourceDeclaration || !symbol.FromSource())
|
||||
return;
|
||||
|
||||
|
||||
@@ -392,6 +392,8 @@ FunctionPointer.cs:
|
||||
GlobalStmt.cs:
|
||||
# 7| [Class] <Program>$
|
||||
# 7| 4: [Method] <Main>$
|
||||
#-----| 2: (Parameters)
|
||||
# 1| 0: [Parameter] args
|
||||
# 7| 4: [BlockStmt] {...}
|
||||
# 11| 0: [ExprStmt] ...;
|
||||
# 11| 0: [MethodCall] call to method WriteLine
|
||||
|
||||
@@ -4,7 +4,7 @@ global_stmt
|
||||
| GlobalStmt.cs:13:1:13:4 | ...; |
|
||||
| GlobalStmt.cs:15:1:17:1 | M(...) |
|
||||
globalBlock
|
||||
| GlobalStmt.cs:7:1:25:1 | {...} | GlobalStmt.cs:7:1:25:1 | <Main>$ | file://:0:0:0:0 | args | GlobalStmt.cs:7:1:25:1 | <Program>$ |
|
||||
| GlobalStmt.cs:7:1:25:1 | {...} | GlobalStmt.cs:7:1:25:1 | <Main>$ | GlobalStmt.cs:1:1:1:0 | args | GlobalStmt.cs:7:1:25:1 | <Program>$ |
|
||||
methods
|
||||
| GlobalStmt.cs:7:1:25:1 | <Main>$ | entry |
|
||||
| GlobalStmt.cs:21:8:21:9 | M1 | non-entry |
|
||||
|
||||
Reference in New Issue
Block a user