[PATCH] D126405: [clang][dataflow] Relax assert on existence of `this` pointee storage

Stanislav Gatev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 25 13:27:23 PDT 2022


sgatev accepted this revision.
sgatev added inline comments.


================
Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:282
     auto *ThisPointeeLoc = Env.getThisPointeeStorageLocation();
-    assert(ThisPointeeLoc != nullptr);
+    if (ThisPointeeLoc == nullptr)
+      return;
----------------
Please document when that could happen.


================
Comment at: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:3181-3190
+    union Union {
+        int A;
+        float B;
+    };
+
+    void foo() {
+        Union A;
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126405



More information about the cfe-commits mailing list