mirror of
https://github.com/github/codeql.git
synced 2026-06-22 21:27:04 +02:00
Emit catch type mentions without variables
This commit is contained in:
committed by
GitHub
parent
568a147f77
commit
4c9fa4dddc
@@ -23,7 +23,9 @@ namespace Semmle.Extraction.CSharp.Entities.Statements
|
||||
}
|
||||
else if (isSpecificCatchClause) // A catch clause of the form 'catch(Ex) { ... }'
|
||||
{
|
||||
trapFile.catch_type(this, Type.Create(Context, Context.GetType(Stmt.Declaration!.Type)).TypeRef, true);
|
||||
var type = Type.Create(Context, Context.GetType(Stmt.Declaration!.Type));
|
||||
trapFile.catch_type(this, type.TypeRef, true);
|
||||
TypeMention.Create(Context, Stmt.Declaration!.Type, this, type);
|
||||
}
|
||||
else // A catch clause of the form 'catch { ... }'
|
||||
{
|
||||
|
||||
@@ -50,6 +50,19 @@ class TypeMentions
|
||||
}
|
||||
}
|
||||
|
||||
class CatchTypeMentions
|
||||
{
|
||||
void F()
|
||||
{
|
||||
try
|
||||
{
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class NameOfMethodGroups
|
||||
{
|
||||
int MethodGroup() => 0;
|
||||
|
||||
Reference in New Issue
Block a user