[llvm-commits] [llvm] r162137 - /llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
Richard Smith
richard-llvm at metafoo.co.uk
Fri Aug 17 14:42:45 PDT 2012
Author: rsmith
Date: Fri Aug 17 16:42:44 2012
New Revision: 162137
URL: http://llvm.org/viewvc/llvm-project?rev=162137&view=rev
Log:
Fix undefined behavior (binding a reference to a dereferenced null pointer) if
SSAUpdater was created and destroyed without being initialized.
Modified:
llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
Modified: llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp?rev=162137&r1=162136&r2=162137&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp Fri Aug 17 16:42:44 2012
@@ -39,7 +39,7 @@
: 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
More information about the llvm-commits
mailing list