Skip to content

Commit e62846e

Browse files
committed
C#: Disregard compiler generated method calls as possible null dereferences.
1 parent 6a31fd7 commit e62846e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/Nullness.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,11 @@ class Dereference extends G::DereferenceableExpr {
526526
not underlyingType instanceof NullableType
527527
)
528528
) else (
529-
this = any(QualifiableExpr qe | not qe.isConditional()).getQualifier() and
529+
this =
530+
any(QualifiableExpr qe |
531+
not qe.isConditional() and
532+
not qe.(MethodCall).isImplicit()
533+
).getQualifier() and
530534
not this instanceof ThisAccess and
531535
not this instanceof BaseAccess and
532536
not this instanceof TypeAccess

0 commit comments

Comments
 (0)