[Lldb-commits] [lldb] r147214 - /lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp

Jim Ingham jingham at apple.com
Thu Dec 22 16:57:42 PST 2011


Author: jingham
Date: Thu Dec 22 18:57:42 2011
New Revision: 147214

URL: http://llvm.org/viewvc/llvm-project?rev=147214&view=rev
Log:
Sanity check the data I am going to read from the extractor to avoid asserting.

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=147214&r1=147213&r2=147214&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 Thu Dec 22 18:57:42 2011
@@ -915,8 +915,14 @@
                         }
                     } 
                 }
+                
+                // These two tests are just sanity checks.  If I somehow get the
+                // type calculation wrong above it is better to just return nothing
+                // than to assert or crash.
                 if (!copy_from_extractor)
                     return return_valobj_sp;
+                if (copy_from_offset + field_byte_width > copy_from_extractor->GetByteSize())
+                    return return_valobj_sp;
                     
                 copy_from_extractor->CopyByteOrderedData (copy_from_offset, 
                                                           field_byte_width, 





More information about the lldb-commits mailing list