We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0355ea8 commit 36eab47Copy full SHA for 36eab47
csharp/ql/lib/semmle/code/csharp/dataflow/Nullness.qll
@@ -544,8 +544,13 @@ class Dereference extends G::DereferenceableExpr {
544
p.hasExtensionMethodModifier() and
545
not emc.isConditional()
546
|
547
- p.fromSource() // assume all non-source extension methods perform a dereference
548
- implies
+ // Assume all non-source extension methods on
+ // (1) nullable types are null-safe
549
+ // (2) non-nullable types are doing a dereference.
550
+ p.fromLibrary() and
551
+ not p.getAnnotatedType().isNullableRefType()
552
+ or
553
+ p.fromSource() and
554
exists(
555
Ssa::ImplicitParameterDefinition def,
556
AssignableDefinitions::ImplicitParameterDefinition pdef
0 commit comments