[Lldb-commits] [lldb] r234239 - Fix an issue where LLDB could crash when trying to figure out the return value layout for an invalid type
Enrico Granata
egranata at apple.com
Mon Apr 6 14:39:57 PDT 2015
Author: enrico
Date: Mon Apr 6 16:39:56 2015
New Revision: 234239
URL: http://llvm.org/viewvc/llvm-project?rev=234239&view=rev
Log:
Fix an issue where LLDB could crash when trying to figure out the return value layout for an invalid type
Modified:
lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
Modified: lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=234239&r1=234238&r2=234239&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Mon Apr 6 16:39:56 2015
@@ -871,6 +871,10 @@ ABISysV_x86_64::GetReturnValueObjectImpl
ClangASTType field_clang_type = return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL);
const size_t field_bit_width = field_clang_type.GetBitSize(&thread);
+ // if we don't know the size of the field (e.g. invalid type), just bail out
+ if (field_bit_width == 0)
+ break;
+
// If there are any unaligned fields, this is stored in memory.
if (field_bit_offset % field_bit_width != 0)
{
More information about the lldb-commits
mailing list