Fixed bug when allocating a ValueStateImpl object in getPersistentState()
using the bump-pointer allocator and a placed new; we accidentally allocated
a ValueStateImpl* instead, causing an overrun when we did a placed new().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46793 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/ValueState.cpp b/Analysis/ValueState.cpp
index 418b06e..00b6607 100644
--- a/Analysis/ValueState.cpp
+++ b/Analysis/ValueState.cpp
@@ -227,7 +227,7 @@
if (ValueStateImpl* I = StateSet.FindNodeOrInsertPos(ID, InsertPos))
return I;
- ValueStateImpl* I = (ValueStateImpl*) Alloc.Allocate<ValueState>();
+ ValueStateImpl* I = (ValueStateImpl*) Alloc.Allocate<ValueStateImpl>();
new (I) ValueStateImpl(State);
StateSet.InsertNode(I, InsertPos);
return I;