[PATCH] D159549: [analyzer] Fix false negative when accessing a nonnull property from a nullable object

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 27 06:34:45 PDT 2023


steakhal added a comment.

For new revisions, prefer creating a PR at GitHub.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp:903-904
   if (!TrackedNullability &&
-      getNullabilityAnnotation(ReturnType) == Nullability::Nullable) {
+      getNullabilityAnnotation(Call.getOriginExpr()->getType()) ==
+          Nullability::Nullable) {
     State = State->set<NullabilityMap>(Region, Nullability::Nullable);
----------------
I'm not sure if `getOriginExpr` is always non-null. How do you know?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159549/new/

https://reviews.llvm.org/D159549



More information about the cfe-commits mailing list