diff options
author | Sebastian Pop <spop@codeaurora.org> | 2014-05-29 19:44:05 +0000 |
---|---|---|
committer | Sebastian Pop <spop@codeaurora.org> | 2014-05-29 19:44:05 +0000 |
commit | e741924230245250448a41d54adc7238e0eac716 (patch) | |
tree | 993fe5ecb38cc22c0e84e8bd070e648d4c3d977b /lib/Analysis | |
parent | d4d04199acab16a7bb9ca186bd95770ced578395 (diff) | |
download | llvm-e741924230245250448a41d54adc7238e0eac716.tar.gz llvm-e741924230245250448a41d54adc7238e0eac716.tar.bz2 llvm-e741924230245250448a41d54adc7238e0eac716.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209837 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 42a7aa2389..935d4158c3 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/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 |