mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
15 lines
369 B
Plaintext
15 lines
369 B
Plaintext
/**
|
|
* @name Test for cast expressions
|
|
*/
|
|
|
|
import csharp
|
|
|
|
from Method m, CastExpr e
|
|
where
|
|
m.hasName("MainIsAsCast") and
|
|
e.getEnclosingCallable() = m and
|
|
e.getExpr().(ParameterAccess).getTarget().getName() = "p" and
|
|
e.getTargetType().(Class).hasQualifiedName("Expressions.Class") and
|
|
e.getEnclosingStmt().getParent().getParent() instanceof IfStmt
|
|
select m, e
|