mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Don't crash analyzing certain quadratics (addrec of {X,+,Y,+,1}).
We're still waiting on code that actually analyzes them properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58592 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2604,6 +2604,11 @@ SolveQuadraticEquation(const SCEVAddRecExpr *AddRec, ScalarEvolution &SE) {
|
||||
// The divisions must be performed as signed divisions.
|
||||
APInt NegB(-B);
|
||||
APInt TwoA( A << 1 );
|
||||
if (TwoA.isMinValue()) {
|
||||
SCEV *CNC = new SCEVCouldNotCompute();
|
||||
return std::make_pair(CNC, CNC);
|
||||
}
|
||||
|
||||
ConstantInt *Solution1 = ConstantInt::get((NegB + SqrtVal).sdiv(TwoA));
|
||||
ConstantInt *Solution2 = ConstantInt::get((NegB - SqrtVal).sdiv(TwoA));
|
||||
|
||||
|
Reference in New Issue
Block a user