diff --git a/lldb/include/lldb/Utility/ProcessStructReader.h b/lldb/include/lldb/Utility/ProcessStructReader.h index ea1b5eca3c3a..7e58091ecded 100644 --- a/lldb/include/lldb/Utility/ProcessStructReader.h +++ b/lldb/include/lldb/Utility/ProcessStructReader.h @@ -63,7 +63,9 @@ namespace lldb_private { // 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(bit_offset/8),static_cast(size)}; + ConstString const_name = ConstString(name.c_str()); + size_t byte_index = static_cast(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));