[llvm-commits] [llvm] r141880 - /llvm/trunk/lib/Analysis/ScalarEvolutionNormalization.cpp
Andrew Trick
atrick at apple.com
Thu Oct 13 11:49:23 PDT 2011
Author: atrick
Date: Thu Oct 13 13:49:23 2011
New Revision: 141880
URL: http://llvm.org/viewvc/llvm-project?rev=141880&view=rev
Log:
Fix memory corruption I introduced a few checkins ago.
Self-review easily caught this obvious bug.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolutionNormalization.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolutionNormalization.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionNormalization.cpp?rev=141880&r1=141879&r2=141880&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolutionNormalization.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolutionNormalization.cpp Thu Oct 13 13:49:23 2011
@@ -202,12 +202,13 @@
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
More information about the llvm-commits
mailing list