Fix undefined behavior (binding a reference to a dereferenced null pointer) if
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 17 Aug 2012 21:42:44 +0000 (21:42 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 17 Aug 2012 21:42:44 +0000 (21:42 +0000)
SSAUpdater was created and destroyed without being initialized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162137 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/SSAUpdater.cpp

index e568a616b6f0a853285561918741bd9eae31bb99..72d4199a2a69c145f694b706b10db0603e8227c7 100644 (file)
@@ -39,7 +39,7 @@ SSAUpdater::SSAUpdater(SmallVectorImpl<PHINode*> *NewPHI)
   : AV(0), ProtoType(0), ProtoName(), InsertedPHIs(NewPHI) {}
 
 SSAUpdater::~SSAUpdater() {
-  delete &getAvailableVals(AV);
+  delete static_cast<AvailableValsTy*>(AV);
 }
 
 /// Initialize - Reset this object to get ready for a new set of SSA