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

BasicAA: assert on another case where aliasGEP shouldn't get a PartialAlias response

llvm-svn: 310420
This commit is contained in:
Nuno Lopes 2017-08-08 21:25:26 +00:00
parent a8aee54f27
commit 11f046ff78

View File

@ -1238,13 +1238,15 @@ AliasResult BasicAAResult::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size,
AliasResult R = aliasCheck(UnderlyingV1, MemoryLocation::UnknownSize,
AAMDNodes(), V2, MemoryLocation::UnknownSize,
V2AAInfo, nullptr, UnderlyingV2);
if (R != MustAlias)
if (R != MustAlias) {
// If V2 may alias GEP base pointer, conservatively returns MayAlias.
// If V2 is known not to alias GEP base pointer, then the two values
// cannot alias per GEP semantics: "Any memory access must be done through
// a pointer value associated with an address range of the memory access,
// otherwise the behavior is undefined.".
assert(R == NoAlias || R == MayAlias);
return R;
}
// If the max search depth is reached the result is undefined
if (GEP1MaxLookupReached)