[analyzer] Nullability: Don't infer nullable when passing as nullable parameter.
You can't really infer anything from that.
This commit is contained in:
parent
60ab30ebce
commit
57adc37fe5
|
@ -728,11 +728,6 @@ void NullabilityChecker::checkPreCall(const CallEvent &Call,
|
|||
}
|
||||
continue;
|
||||
}
|
||||
// No tracked nullability yet.
|
||||
if (ArgExprTypeLevelNullability != Nullability::Nullable)
|
||||
continue;
|
||||
State = State->set<NullabilityMap>(
|
||||
Region, NullabilityState(ArgExprTypeLevelNullability, ArgExpr));
|
||||
}
|
||||
if (State != OrigState)
|
||||
C.addTransition(State);
|
||||
|
|
12
clang/test/Analysis/nullability.m
Normal file
12
clang/test/Analysis/nullability.m
Normal file
|
@ -0,0 +1,12 @@
|
|||
// RUN: %clang_analyze_cc1 -analyzer-checker core,nullability -w -verify %s
|
||||
|
||||
// expected-no-diagnostics
|
||||
|
||||
id _Nonnull conjure_nonnull();
|
||||
void use_nullable(_Nullable id x);
|
||||
|
||||
id _Nonnull foo() {
|
||||
void *j = conjure_nonnull();
|
||||
use_nullable(j);
|
||||
return j; // no-warning
|
||||
}
|
Loading…
Reference in a new issue