[llvm-commits] CVS: poolalloc/runtime/PoolAllocator/PoolAllocatorChained.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Nov 7 17:57:01 PST 2003


Changes in directory poolalloc/runtime/PoolAllocator:

PoolAllocatorChained.cpp updated: 1.24 -> 1.25

---
Log message:

Don't segfault freeing the last slab :(


---
Diffs of the changes:  (+1 -1)

Index: poolalloc/runtime/PoolAllocator/PoolAllocatorChained.cpp
diff -u poolalloc/runtime/PoolAllocator/PoolAllocatorChained.cpp:1.24 poolalloc/runtime/PoolAllocator/PoolAllocatorChained.cpp:1.25
--- poolalloc/runtime/PoolAllocator/PoolAllocatorChained.cpp:1.24	Fri Nov  7 12:09:00 2003
+++ poolalloc/runtime/PoolAllocator/PoolAllocatorChained.cpp	Fri Nov  7 17:55:35 2003
@@ -645,7 +645,7 @@
     // If we can free this pool, check to see if there are any empty slabs at
     // the start of this list.  If so, delete the FirstSlab!
     PoolSlab *FirstSlab = (PoolSlab*)Pool->Ptr1;
-    if (Pool->FreeablePool && FirstSlab->isEmpty()) {
+    if (Pool->FreeablePool && FirstSlab && FirstSlab->isEmpty()) {
       // Here we choose to delete FirstSlab instead of the pool we just freed
       // from because the pool we just freed from is more likely to be in the
       // processor cache.





More information about the llvm-commits mailing list