gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land.
================ Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:683 - StorageLocation *LocRet = State.Env.getStorageLocation(*E, SkipPast::None); - if (LocRet != nullptr) - return; - - StorageLocation *LocArg = - State.Env.getStorageLocation(*E->getArg(0), SkipPast::Reference); - - if (LocArg == nullptr) - return; - - Value *ValArg = State.Env.getValue(*LocArg); - if (ValArg == nullptr) - ValArg = &createOptionalValue(State.Env.makeAtomicBoolValue(), State.Env); - - // Create a new storage location - LocRet = &State.Env.createStorageLocation(*E); - State.Env.setStorageLocation(*E, *LocRet); - - State.Env.setValue(*LocRet, *ValArg); + if (auto *Loc = State.Env.getStorageLocationStrict(*E->getArg(0))) + State.Env.setStorageLocationStrict(*E, *Loc); ---------------- Should we add an assert that it is not a value? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155202/new/ https://reviews.llvm.org/D155202 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits