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.
llvm-svn: 225461
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index ee7ed9b..1bfd969 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -457,8 +457,8 @@
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;
}