Author: davide Date: Mon Oct 22 17:31:46 2018 New Revision: 344982 URL: http://llvm.org/viewvc/llvm-project?rev=344982&view=rev Log: [ValueObject] Stop assuming types are non-zero sized.
Some backends might violate this assumption. No test case upstream unfortunately as this is not the case with C++, but I'm going to add a test in swift language support. <rdar://problem/40962410> Modified: lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp Modified: lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp?rev=344982&r1=344981&r2=344982&view=diff ============================================================================== --- lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp (original) +++ lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp Mon Oct 22 17:31:46 2018 @@ -77,7 +77,13 @@ ValueObject *ValueObjectConstResultImpl: ignore_array_bounds, child_name_str, child_byte_size, child_byte_offset, child_bitfield_bit_size, child_bitfield_bit_offset, child_is_base_class, child_is_deref_of_parent, m_impl_backend, language_flags); - if (child_compiler_type && child_byte_size) { + + // One might think we should check that the size of the children + // is always strictly positive, hence we could avoid creating a + // ValueObject if that's not the case, but it turns out there + // are languages out there which allow zero-size types with + // children (e.g. Swift). + if (child_compiler_type) { if (synthetic_index) child_byte_offset += child_byte_size * synthetic_index; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits