Fixed a crash in the class uniq'ing code where we

didn't check if the two classes had the same number
of members.

<rdar://problem/11678873>

llvm-svn: 159880
This commit is contained in:
Sean Callanan 2012-07-07 00:29:33 +00:00
parent 56543735c9
commit 210b815f9d
1 changed files with 12 additions and 0 deletions

View File

@ -4995,6 +4995,18 @@ SymbolFileDWARF::CopyUniqueClassMethodTypes (Type *class_type,
if (src_size && dst_size)
{
if (src_size != dst_size)
{
if (log)
log->Printf("warning: tried to unique class DIE 0x%8.8x to 0x%8.8x, but they didn't have the same size (src=%d, dst=%d)",
src_class_die->GetOffset(),
dst_class_die->GetOffset(),
src_size,
dst_size);
return false;
}
uint32_t idx;
for (idx = 0; idx < src_size; ++idx)
{