summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2017-10-30 23:59:51 +0000
committerPhilip Reames <listmail@philipreames.com>2017-10-30 23:59:51 +0000
commit9c3cbeea3943dcfa096634eb94c8acc5ff8bf640 (patch)
tree5b22227e9913884476f782da3708c7414c95e999 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parentc38ba6697fc8b9f5cb577d27c07dc9ff46ae6b17 (diff)
downloadbcm5719-llvm-9c3cbeea3943dcfa096634eb94c8acc5ff8bf640.tar.gz
bcm5719-llvm-9c3cbeea3943dcfa096634eb94c8acc5ff8bf640.zip
[CGP] Fix crash on i96 bit multiply
Issue found by llvm-isel-fuzzer on OSS fuzz, https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3725 If anyone actually cares about > 64 bit arithmetic, there's a lot more to do in this area. There's a bunch of obviously wrong code in the same function. I don't have the time to fix all of them and am just using this to understand what the workflow for fixing fuzzer cases might look like. llvm-svn: 316967
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 0a417e34084..13bdad71252 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -4032,7 +4032,7 @@ bool AddressingModeMatcher::matchOperationAddr(User *AddrInst, unsigned Opcode,
case Instruction::Shl: {
// Can only handle X*C and X << C.
ConstantInt *RHS = dyn_cast<ConstantInt>(AddrInst->getOperand(1));
- if (!RHS)
+ if (!RHS || RHS->getBitWidth() > 64)
return false;
int64_t Scale = RHS->getSExtValue();
if (Opcode == Instruction::Shl)
OpenPOWER on IntegriCloud