[polly] r225461 - Fix a crash in our error reporting

Tobias Grosser tobias at grosser.es
Thu Jan 8 11:03:11 PST 2015

Author: grosser
Date: Thu Jan  8 13:03:10 2015
New Revision: 225461

URL: http://llvm.org/viewvc/llvm-project?rev=225461&view=rev
Fix a crash in our error reporting

AF = dyn_cast<SCEVAddRecExpr>(Pair.second) may be NULL for some SCEVs that we do
not support. When reporting the error we still want to pass a pointer that is
known to always be non-NULL.

I do not yet have a test case for this, unfortunately.


Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=225461&r1=225460&r2=225461&view=diff
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Thu Jan  8 13:03:10 2015
@@ -457,8 +457,8 @@ bool ScopDetection::hasAffineMemoryAcces
       if (IsNonAffine) {
         BasePtrHasNonAffine = true;
         if (!AllowNonAffine)
-          invalid<ReportNonAffineAccess>(Context, /*Assert=*/true, AF, Insn,
-                                         BaseValue);
+          invalid<ReportNonAffineAccess>(Context, /*Assert=*/true, Pair.second,
+                                         Insn, BaseValue);
         if (!KeepGoing && !AllowNonAffine)
           return false;

More information about the llvm-commits mailing list