]> granicus.if.org Git - clang/commitdiff
Fixed bug when allocating a ValueStateImpl object in getPersistentState()
authorTed Kremenek <kremenek@apple.com>
Wed, 6 Feb 2008 02:45:20 +0000 (02:45 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 6 Feb 2008 02:45:20 +0000 (02:45 +0000)
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

Analysis/ValueState.cpp

index 418b06e725c3d60dec250681dfd4598ace7f68bb..00b6607536b59500a4869ee453e91938535296e0 100644 (file)
@@ -227,7 +227,7 @@ ValueStateManager::getPersistentState(const ValueStateImpl &State) {
   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;