[CGP] Ensure address offset is representable as int64_t
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 22 May 2020 15:59:05 +0000 (16:59 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 22 May 2020 16:00:22 +0000 (17:00 +0100)
commitc479052a74b204071902c5290059de0f2365db47
tree9bba6b4221105daeb9f73400dae7aab78d2e3c47
parent2f7c24fe303f09308f1032515379f0abf20c5f90
[CGP] Ensure address offset is representable as int64_t

AddressingModeMatcher::matchAddr was calling getSExtValue for a constant before ensuring that we can actually represent the value as int64_t

Fixes PR46004 / OSSFuzz#22357
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/test/CodeGen/X86/pr46004.ll [new file with mode: 0644]