Fix memory corruption I introduced a few checkins ago.

Self-review easily caught this obvious bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141880 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Trick 2011-10-13 18:49:23 +00:00
parent e9d3c1cfbe
commit 7f1653a7ae

View File

@ -202,12 +202,13 @@ TransformSubExpr(const SCEV *S, Instruction *User, Value *OperandValToReplace) {
if (isa<SCEVConstant>(S) || isa<SCEVUnknown>(S))
return S;
const SCEV *&ExprRef = Transformed[S];
if (ExprRef)
return ExprRef;
const SCEV *Result = Transformed.lookup(S);
if (Result)
return Result;
ExprRef = TransformImpl(S, User, OperandValToReplace);
return ExprRef;
Result = TransformImpl(S, User, OperandValToReplace);
Transformed[S] = Result;
return Result;
}
/// Top level driver for transforming an expression DAG into its requested