1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 13:11:39 +01:00

GVN-hoist: do not dereference null pointers

there may be basic blocks without memory accesses, in which case the
list of accesses is a null pointer.

llvm-svn: 282175
This commit is contained in:
Sebastian Pop 2016-09-22 17:22:58 +00:00
parent 344cd70c0b
commit 2879352ee0

View File

@ -338,6 +338,9 @@ private:
bool ReachedNewPt = false;
MemoryLocation DefLoc = MemoryLocation::get(OldPt);
const MemorySSA::AccessList *Acc = MSSA->getBlockAccesses(BB);
if (!Acc)
return false;
for (const MemoryAccess &MA : *Acc) {
auto *MU = dyn_cast<MemoryUse>(&MA);
if (!MU)