diff --git a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp --- a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp +++ b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp @@ -122,12 +122,11 @@ Value *MergedVal = nullptr; if (auto *StructVal1 = dyn_cast(&Val1)) { - auto *StructVal2 = cast(&Val2); - // Values to be merged are always associated with the same location in // `LocToVal`. The location stored in `StructVal` should therefore also // be the same. - assert(&StructVal1->getAggregateLoc() == &StructVal2->getAggregateLoc()); + assert(&StructVal1->getAggregateLoc() == + &cast(&Val2)->getAggregateLoc()); // `StructVal1` and `StructVal2` may have different properties associated // with them. Create a new `StructValue` without any properties so that we