[Lldb-commits] [lldb] r230661 - Fix a bug where LLDB could be convinced to attempt to extract a bitfield of size 0, and consequently crash

Enrico Granata egranata at apple.com
Thu Feb 26 11:00:23 PST 2015


Author: enrico
Date: Thu Feb 26 13:00:23 2015
New Revision: 230661

URL: http://llvm.org/viewvc/llvm-project?rev=230661&view=rev
Log:
Fix a bug where LLDB could be convinced to attempt to extract a bitfield of size 0, and consequently crash

Modified:
    lldb/trunk/source/Core/DataExtractor.cpp

Modified: lldb/trunk/source/Core/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=230661&r1=230660&r2=230661&view=diff
==============================================================================
--- lldb/trunk/source/Core/DataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DataExtractor.cpp Thu Feb 26 13:00:23 2015
@@ -1710,7 +1710,7 @@ DataExtractor::Dump (Stream *s,
             {
                 size_t complex_int_byte_size = item_byte_size / 2;
                 
-                if (complex_int_byte_size <= 8)
+                if (complex_int_byte_size > 0 && complex_int_byte_size <= 8)
                 {
                     s->Printf("%" PRIu64, GetMaxU64Bitfield(&offset, complex_int_byte_size, 0, 0));
                     s->Printf(" + %" PRIu64 "i", GetMaxU64Bitfield(&offset, complex_int_byte_size, 0, 0));





More information about the lldb-commits mailing list