[llvm] r209837 - fail to find dimensions when ElementSize is nullptr

Sebastian Pop spop at codeaurora.org
Thu May 29 12:44:05 PDT 2014


Author: spop
Date: Thu May 29 14:44:05 2014
New Revision: 209837

URL: http://llvm.org/viewvc/llvm-project?rev=209837&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=209837&r1=209836&r2=209837&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Thu May 29 14:44:05 2014
@@ -7370,7 +7370,7 @@ void ScalarEvolution::findArrayDimension
                                           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





More information about the llvm-commits mailing list