summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/Materializer.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2015-11-04 20:32:27 +0000
committerJim Ingham <jingham@apple.com>2015-11-04 20:32:27 +0000
commit2c38141423f6ed6ec4db641be76f61631366cbb1 (patch)
treeadde94fb56aa019d45639c2b75d83bbd5604ee67 /lldb/source/Expression/Materializer.cpp
parent1e41784f202df14a7171c5b7d98950d254720dda (diff)
downloadbcm5719-llvm-2c38141423f6ed6ec4db641be76f61631366cbb1.tar.gz
bcm5719-llvm-2c38141423f6ed6ec4db641be76f61631366cbb1.zip
Add "zero_memory" option to IRMemoryMap::FindSpace & IRMemoryMap::Malloc. Zero out
the Expression ResultVariable so it's in a known initial state. llvm-svn: 252072
Diffstat (limited to 'lldb/source/Expression/Materializer.cpp')
-rw-r--r--lldb/source/Expression/Materializer.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/lldb/source/Expression/Materializer.cpp b/lldb/source/Expression/Materializer.cpp
index 3c73f49838a..f69a1cd93f8 100644
--- a/lldb/source/Expression/Materializer.cpp
+++ b/lldb/source/Expression/Materializer.cpp
@@ -87,11 +87,13 @@ public:
// Allocate a spare memory area to store the persistent variable's contents.
Error allocate_error;
+ const bool zero_memory = false;
lldb::addr_t mem = map.Malloc(m_persistent_variable_sp->GetByteSize(),
8,
lldb::ePermissionsReadable | lldb::ePermissionsWritable,
IRMemoryMap::eAllocationPolicyMirror,
+ zero_memory,
allocate_error);
if (!allocate_error.Success())
@@ -552,8 +554,15 @@ public:
byte_align = 1;
Error alloc_error;
+ const bool zero_memory = false;
+
+ m_temporary_allocation = map.Malloc(data.GetByteSize(),
+ byte_align,
+ lldb::ePermissionsReadable | lldb::ePermissionsWritable,
+ IRMemoryMap::eAllocationPolicyMirror,
+ zero_memory,
+ alloc_error);
- m_temporary_allocation = map.Malloc(data.GetByteSize(), byte_align, lldb::ePermissionsReadable | lldb::ePermissionsWritable, IRMemoryMap::eAllocationPolicyMirror, alloc_error);
m_temporary_allocation_size = data.GetByteSize();
m_original_data.reset(new DataBufferHeap(data.GetDataStart(), data.GetByteSize()));
@@ -817,8 +826,14 @@ public:
byte_align = 1;
Error alloc_error;
-
- m_temporary_allocation = map.Malloc(byte_size, byte_align, lldb::ePermissionsReadable | lldb::ePermissionsWritable, IRMemoryMap::eAllocationPolicyMirror, alloc_error);
+ const bool zero_memory = true;
+
+ m_temporary_allocation = map.Malloc(byte_size,
+ byte_align,
+ lldb::ePermissionsReadable | lldb::ePermissionsWritable,
+ IRMemoryMap::eAllocationPolicyMirror,
+ zero_memory,
+ alloc_error);
m_temporary_allocation_size = byte_size;
if (!alloc_error.Success())
OpenPOWER on IntegriCloud