[MemorySSA] Temporary fix assert when reaching 0 limit.
llvm-svn: 357327
diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp
index 7a3f2db..a810031 100644
--- a/llvm/lib/Analysis/MemorySSA.cpp
+++ b/llvm/lib/Analysis/MemorySSA.cpp
@@ -543,8 +543,11 @@
walkToPhiOrClobber(DefPath &Desc, const MemoryAccess *StopAt = nullptr,
const MemoryAccess *SkipStopAt = nullptr) const {
assert(!isa<MemoryUse>(Desc.Last) && "Uses don't exist in my world");
- assert(UpwardWalkLimit && *UpwardWalkLimit > 0 &&
- "Need a positive walk limit");
+ assert(UpwardWalkLimit && "Need a valid walk limit");
+ // This will not do any alias() calls. It returns in the first iteration in
+ // the loop below.
+ if (*UpwardWalkLimit == 0)
+ (*UpwardWalkLimit)++;
for (MemoryAccess *Current : def_chain(Desc.Last)) {
Desc.Last = Current;