diff --git a/clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp b/clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp --- a/clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp +++ b/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));