diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-25 18:20:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-25 18:20:01 +0000 |
commit | 58b1ac76d470eb5faa7e98feae97c4906d4d146e (patch) | |
tree | 2995fda6b8e56e30e1824c386a58c312e1b91d56 /lib | |
parent | 411c28540454c536519f04a2fde461e91ad1f661 (diff) |
Fix PR3667
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 62554a5e91..61ca5de5b8 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -10837,7 +10837,7 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) { // out, perform the transformation. Note, we don't know whether Scale is // signed or not. We'll use unsigned version of division/modulo // operation after making sure Scale doesn't have the sign bit set. - if (Scale && Scale->getSExtValue() >= 0LL && + if (ArrayEltSize && Scale && Scale->getSExtValue() >= 0LL && Scale->getZExtValue() % ArrayEltSize == 0) { Scale = ConstantInt::get(Scale->getType(), Scale->getZExtValue() / ArrayEltSize); |