[PATCH] D127502: [clang][dataflow] Don't `assert` full LHS coverage in `optional` model

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 10 12:11:24 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa9ad689e352d: [clang][dataflow] Don't `assert` full LHS coverage in `optional` model (authored by samestep, committed by ymandel).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127502

Files:
  clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp


Index: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp
===================================================================
--- clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp
+++ clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp
@@ -450,7 +450,8 @@
 
   auto *OptionalLoc =
       State.Env.getStorageLocation(*E->getArg(0), SkipPast::Reference);
-  assert(OptionalLoc != nullptr);
+  if (OptionalLoc == nullptr)
+    return;
 
   State.Env.setValue(*OptionalLoc, createOptionalValue(State.Env, HasValueVal));
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127502.436008.patch
Type: text/x-patch
Size: 585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220610/4d5d5898/attachment-0001.bin>


More information about the cfe-commits mailing list