summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorSebastian Pop <spop@codeaurora.org>2014-05-29 19:44:05 +0000
committerSebastian Pop <spop@codeaurora.org>2014-05-29 19:44:05 +0000
commit5352408169d6b9927bc7fffd590fe8850eb93bb6 (patch)
treeb5ebb322c9a1901ba40b584b7a1022fab6bb3d6c /llvm/lib/Analysis/ScalarEvolution.cpp
parentbdd2b3c7c52def557019b6513fcc3027136aa170 (diff)
downloadbcm5719-llvm-5352408169d6b9927bc7fffd590fe8850eb93bb6.tar.gz
bcm5719-llvm-5352408169d6b9927bc7fffd590fe8850eb93bb6.zip
fail to find dimensions when ElementSize is nullptr
when ScalarEvolution::getElementSize returns nullptr it is safe to early return in ScalarEvolution::findArrayDimensions such that we avoid later problems when we try to divide the terms by ElementSize. llvm-svn: 209837
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 42a7aa23896..935d4158c39 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -7370,7 +7370,7 @@ void ScalarEvolution::findArrayDimensions(SmallVectorImpl<const SCEV *> &Terms,
SmallVectorImpl<const SCEV *> &Sizes,
const SCEV *ElementSize) const {
- if (Terms.size() < 1)
+ if (Terms.size() < 1 || !ElementSize)
return;
// Early return when Terms do not contain parameters: we do not delinearize
OpenPOWER on IntegriCloud