[PATCH] D127502: [clang][dataflow] Don't `assert` full LHS coverage in `optional` model
Sam Estep via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 10 08:21:21 PDT 2022
samestep created this revision.
samestep added a reviewer: ymandel.
Herald added subscribers: tschuett, steakhal, xazax.hun.
Herald added a project: All.
samestep requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Repository:
rG LLVM Github Monorepo
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.435923.patch
Type: text/x-patch
Size: 585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220610/6239c46c/attachment.bin>
More information about the cfe-commits
mailing list