mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
BasicAA: We need to check both access sizes when comparing a gep and an
underlying object of unknown size. Fixes PR18460. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199351 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1009,7 +1009,15 @@ BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size,
|
||||
return NoAlias;
|
||||
}
|
||||
} else {
|
||||
if (V1Size != UnknownSize) {
|
||||
// We have the situation where:
|
||||
// + +
|
||||
// | BaseOffset |
|
||||
// ---------------->|
|
||||
// |-->V1Size |-------> V2Size
|
||||
// GEP1 V2
|
||||
// We need to know that V2Size is not unknown, otherwise we might have
|
||||
// stripped a gep with negative index ('gep <ptr>, -1, ...).
|
||||
if (V1Size != UnknownSize && V2Size != UnknownSize) {
|
||||
if (-(uint64_t)GEP1BaseOffset < V1Size)
|
||||
return PartialAlias;
|
||||
return NoAlias;
|
||||
|
||||
Reference in New Issue
Block a user