I have revised the patch after review by Zachary.

It seems the crash was triggered specificaly when indexing m_fields via the 
ConstString constructed inline, so I still had to pull that out to a local 
variable however.


http://reviews.llvm.org/D6702

Files:
  include/lldb/Utility/ProcessStructReader.h

Index: include/lldb/Utility/ProcessStructReader.h
===================================================================
--- include/lldb/Utility/ProcessStructReader.h
+++ include/lldb/Utility/ProcessStructReader.h
@@ -63,7 +63,9 @@
                 // no support for things larger than a uint64_t (yet)
                 if (size > 8)
                     return;
-                m_fields[ConstString(name.c_str())] = 
FieldImpl{field_type,static_cast<size_t>(bit_offset/8),static_cast<size_t>(size)};
+                ConstString const_name = ConstString(name.c_str());
+                size_t byte_index = static_cast<size_t>(bit_offset/8);
+                m_fields[const_name] = FieldImpl{field_type,byte_index,size};
             }
             size_t total_size = struct_type.GetByteSize();
             lldb::DataBufferSP buffer_sp(new DataBufferHeap(total_size,0));

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
Index: include/lldb/Utility/ProcessStructReader.h
===================================================================
--- include/lldb/Utility/ProcessStructReader.h
+++ include/lldb/Utility/ProcessStructReader.h
@@ -63,7 +63,9 @@
                 // no support for things larger than a uint64_t (yet)
                 if (size > 8)
                     return;
-                m_fields[ConstString(name.c_str())] = FieldImpl{field_type,static_cast<size_t>(bit_offset/8),static_cast<size_t>(size)};
+                ConstString const_name = ConstString(name.c_str());
+                size_t byte_index = static_cast<size_t>(bit_offset/8);
+                m_fields[const_name] = FieldImpl{field_type,byte_index,size};
             }
             size_t total_size = struct_type.GetByteSize();
             lldb::DataBufferSP buffer_sp(new DataBufferHeap(total_size,0));
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to