This can only happen if offset types that are larger than the
pointer size are involved. The previous implementation did not
assert in this case because it initialized the APInts to the
width of one of the variables -- though I strongly suspect it
did not compute correct results in this case.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32621
reported by fhahn.
const VariableGEPIndex &Var0 = VarIndices[0], &Var1 = VarIndices[1];
if (Var0.ZExtBits != Var1.ZExtBits || Var0.SExtBits != Var1.SExtBits ||
- Var0.Scale != -Var1.Scale)
+ Var0.Scale != -Var1.Scale || Var0.V->getType() != Var1.V->getType())
return false;
// We'll strip off the Extensions of Var0 and Var1 and do another round
%c = bitcast i8* %c.8 to i32*
ret void
}
+
+; CHECK-LABEL: different_large_bitwidths
+; MayAlias: i64* %p1, i64* %p2
+define void @different_large_bitwidths(i8* %a, i64 %i, i128 %j) {
+ %p1 = getelementptr i8, i8* %a, i64 %i
+ %p2 = getelementptr i8, i8* %a, i128 %j
+ ret void
+}