summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopRotation.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-09-01 10:29:33 +0000
committerDuncan Sands <baldrick@free.fr>2010-09-01 10:29:33 +0000
commit4d588bceb035589ade874f432d70a41bb7ec6273 (patch)
treeb146e38731affa01ddc2147fcde8b1caea7657f2 /lib/Transforms/Scalar/LoopRotation.cpp
parent248e7592b5d7ccba5def625300960a00dddd6e55 (diff)
downloadllvm-4d588bceb035589ade874f432d70a41bb7ec6273.tar.gz
llvm-4d588bceb035589ade874f432d70a41bb7ec6273.tar.bz2
llvm-4d588bceb035589ade874f432d70a41bb7ec6273.tar.xz
If PrototypeValue is erased in the middle of using the SSAUpdator
then the SSAUpdator may access freed memory. Instead, simply pass in the type and name explicitly, which is all that was used anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112699 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopRotation.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopRotation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopRotation.cpp b/lib/Transforms/Scalar/LoopRotation.cpp
index 31957ddac1..65acc1d925 100644
--- a/lib/Transforms/Scalar/LoopRotation.cpp
+++ b/lib/Transforms/Scalar/LoopRotation.cpp
@@ -221,7 +221,7 @@ bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) {
// The value now exits in two versions: the initial value in the preheader
// and the loop "next" value in the original header.
- SSA.Initialize(OrigHeaderVal);
+ SSA.Initialize(OrigHeaderVal->getType(), OrigHeaderVal->getName());
SSA.AddAvailableValue(OrigHeader, OrigHeaderVal);
SSA.AddAvailableValue(OrigPreHeader, OrigPreHeaderVal);