[BasicAA] fix build break by converting the previously introduced assert into an if stmt

Apparently V1Size == -1 doest imply V2Size == -1, which is a bit surprising to me.

llvm-svn: 317812
This commit is contained in:
Nuno Lopes 2017-11-09 17:06:42 +00:00
parent 9a5e64f56a
commit 9f82a2b60e
1 changed files with 2 additions and 2 deletions

View File

@ -1289,10 +1289,10 @@ AliasResult BasicAAResult::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size,
// greater, we know they do not overlap. // greater, we know they do not overlap.
if (GEP1BaseOffset != 0 && DecompGEP1.VarIndices.empty()) { if (GEP1BaseOffset != 0 && DecompGEP1.VarIndices.empty()) {
if (GEP1BaseOffset >= 0) { if (GEP1BaseOffset >= 0) {
if (V2Size != MemoryLocation::UnknownSize) { if (V1Size != MemoryLocation::UnknownSize &&
V2Size != MemoryLocation::UnknownSize) {
if ((uint64_t)GEP1BaseOffset < V2Size) if ((uint64_t)GEP1BaseOffset < V2Size)
return PartialAlias; return PartialAlias;
assert(V1Size != MemoryLocation::UnknownSize);
return NoAlias; return NoAlias;
} }
} else { } else {