Index: lib/Analysis/MemorySSAUpdater.cpp =================================================================== --- lib/Analysis/MemorySSAUpdater.cpp +++ lib/Analysis/MemorySSAUpdater.cpp @@ -125,11 +125,10 @@ } else { // Otherwise, have to walk the all access iterator. auto Iter = MA->getReverseIterator(); - ++Iter; while (&*Iter != &*Defs->begin()) { - if (!isa(*Iter)) - return &*Iter; --Iter; + if (!isa(*Iter)) + return nullptr; } // At this point it must be pointing at firstdef assert(&*Iter == &*Defs->begin() &&