mirror of
https://github.com/github/codeql.git
synced 2025-12-18 18:10:39 +01:00
For example, in
```
void M(object x)
{
var y = x != null ? "" : null;
if (y != null)
x.ToString();
}
```
the guard `y != null` implies that the guard `x != null` must be true.
6 lines
157 B
Plaintext
6 lines
157 B
Plaintext
import csharp
|
|
import semmle.code.csharp.controlflow.Guards
|
|
|
|
from Expr e1, AbstractValue v, Expr e2
|
|
select Internal::getAnEqualityCheck(e1, v, e2), v, e1, e2
|