From: Richard Smith Date: Fri, 17 Aug 2012 21:42:44 +0000 (+0000) Subject: Fix undefined behavior (binding a reference to a dereferenced null pointer) if X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1cec7a05ee41725ec97b41608fe16d58c8c5b103;p=oota-llvm.git Fix undefined behavior (binding a reference to a dereferenced null pointer) if 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 --- diff --git a/lib/Transforms/Utils/SSAUpdater.cpp b/lib/Transforms/Utils/SSAUpdater.cpp index e568a616b6f..72d4199a2a6 100644 --- a/lib/Transforms/Utils/SSAUpdater.cpp +++ b/lib/Transforms/Utils/SSAUpdater.cpp @@ -39,7 +39,7 @@ SSAUpdater::SSAUpdater(SmallVectorImpl *NewPHI) : AV(0), ProtoType(0), ProtoName(), InsertedPHIs(NewPHI) {} SSAUpdater::~SSAUpdater() { - delete &getAvailableVals(AV); + delete static_cast(AV); } /// Initialize - Reset this object to get ready for a new set of SSA