diff options
author | Andrew Trick <atrick@apple.com> | 2011-06-01 19:14:56 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2011-06-01 19:14:56 +0000 |
commit | 8ef3ad049d5a38af2ba03504e264d0aa650abe01 (patch) | |
tree | 08508fcf4b887ea874c5afe13f08f96b2963ce76 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | e9cc8e90b7bfee369a117d6304dd8041e5412460 (diff) | |
download | bcm5719-llvm-8ef3ad049d5a38af2ba03504e264d0aa650abe01.tar.gz bcm5719-llvm-8ef3ad049d5a38af2ba03504e264d0aa650abe01.zip |
SCEV: missing null check fix for r132360, dragonegg crash.
llvm-svn: 132416
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index ef390c5a3ee..025718e09fe 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -1081,9 +1081,8 @@ static const SCEV *getPreStartForSignExtend(const SCEVAddRecExpr *AR, const SCEVAddRecExpr *PreAR = dyn_cast<SCEVAddRecExpr>( SE->getAddRecExpr(PreStart, Step, L, SCEV::FlagAnyWrap)); - if (PreAR && PreAR->getNoWrapFlags(SCEV::FlagNSW)) { + if (PreAR && PreAR->getNoWrapFlags(SCEV::FlagNSW)) return PreStart; - } // 2. Direct overflow check on the step operation's expression. unsigned BitWidth = SE->getTypeSizeInBits(AR->getType()); @@ -1104,7 +1103,8 @@ static const SCEV *getPreStartForSignExtend(const SCEVAddRecExpr *AR, ICmpInst::Predicate Pred; const SCEV *OverflowLimit = getOverflowLimitForStep(Step, &Pred, SE); - if (SE->isLoopEntryGuardedByCond(L, Pred, PreStart, OverflowLimit)) { + if (OverflowLimit && + SE->isLoopEntryGuardedByCond(L, Pred, PreStart, OverflowLimit)) { return PreStart; } return 0; |