[Lldb-commits] [lldb] r151940 - /lldb/trunk/source/Expression/RecordingMemoryManager.cpp

Jim Ingham jingham at apple.com
Fri Mar 2 13:34:28 PST 2012


Author: jingham
Date: Fri Mar  2 15:34:28 2012
New Revision: 151940

URL: http://llvm.org/viewvc/llvm-project?rev=151940&view=rev
Log:
For Sean: handle the case where you are asked for a 0 byte allocation with 0 alignment.

Modified:
    lldb/trunk/source/Expression/RecordingMemoryManager.cpp

Modified: lldb/trunk/source/Expression/RecordingMemoryManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/RecordingMemoryManager.cpp?rev=151940&r1=151939&r2=151940&view=diff
==============================================================================
--- lldb/trunk/source/Expression/RecordingMemoryManager.cpp (original)
+++ lldb/trunk/source/Expression/RecordingMemoryManager.cpp Fri Mar  2 15:34:28 2012
@@ -238,10 +238,10 @@
         
         lldb_private::Error err;
         
-        size_t allocation_size = ai->m_size + ai->m_alignment - 1;
+        size_t allocation_size = (ai->m_size ? ai->m_size : 1) + ai->m_alignment - 1;
         
         if (allocation_size == 0)
-            allocation_size = 1;
+            allocation_size = 1;œ
         
         ai->m_remote_allocation = process.AllocateMemory(
             allocation_size,





More information about the lldb-commits mailing list