[PATCH] D129097: [clang][dataflow] Handle null pointers of type std::nullptr_t

Stanislav Gatev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 2 13:34:27 PDT 2022


sgatev added inline comments.


================
Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:96
   ///
   ///  `Type` must not be null.
   StorageLocation &getStableStorageLocation(QualType Type);
----------------
This is inconsistent with the change introduced by this patch.


================
Comment at: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp:27
 DataflowAnalysisContext::getStableStorageLocation(QualType Type) {
-  assert(!Type.isNull());
-  if (Type->isStructureOrClassType() || Type->isUnionType()) {
+  if (!Type.isNull() &&
+      (Type->isStructureOrClassType() || Type->isUnionType())) {
----------------
What does that mean? We are analyzing an incomplete translation unit? Why would the type ever be null here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129097



More information about the cfe-commits mailing list