[PATCH] D122841: [analyzer] Add option for AddrSpace in core.NullDereference check

Bal√°zs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 9 03:48:33 PDT 2022


steakhal accepted this revision.
steakhal added a comment.
This revision is now accepted and ready to land.

No major issues left.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp:331
+  auto *Chk = mgr.registerChecker<DereferenceChecker>();
+  // auto *Chk = mgr.getChecker<DereferenceChecker>();
+  Chk->DetectAllNullDereferences =
----------------
steakhal wrote:
> dead-code?
This still looks dead.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp:56
+
+  bool SuppressAddressSpaces = false;
 };
----------------
If I'm correct, we tend to use the 'DefaultBool' instead of plain old bools for checker options. Could you please check if this is the case and consolidate this?


================
Comment at: clang/test/Analysis/cast-value-notes.cpp:20
+// RUN: -verify -DDEFAULT_TRIPLE %s 2>&1 | FileCheck %s\
+// RUN: -check-prefix=DEFAULT-CHECK
+
----------------
Nit: the default triple is the host/native triple, but you did actually pin it to x86. Hence it might not be the default on other platforms.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122841



More information about the cfe-commits mailing list