Files
codeql/csharp/ql/test/library-tests/statements/TryCatch6.ql
2018-12-20 10:19:59 +01:00

17 lines
431 B
Plaintext

/**
* @name Test for try catches
*/
import csharp
from Method m, TryStmt s, LocalVariable v, LocalVariableAccess a
where
s.getEnclosingCallable() = m and
m.getName() = "MainTryThrow" and
s.getCatchClause(0).(SpecificCatchClause).getVariable() = v and
v.getName() = "e" and
v.getType().getName() = "Exception" and
a.getTarget() = v and
a.getEnclosingStmt().getParent() = s.getCatchClause(0).getBlock()
select v, a