- If we're asked to generate an entry for a tag we don't recognize,
  return an error so don't then attempt to add a null/invalid entry into the
  compilation unit's entry list and later crash dereferencing it.
This commit is contained in:
Rene Gollent
2012-07-14 12:09:11 -04:00
parent c163f973e6
commit 6faa3c9766
2 changed files with 6 additions and 1 deletions
@@ -2697,6 +2697,7 @@ DebugInfoEntryFactory::CreateDebugInfoEntry(uint16 tag, DebugInfoEntry*& _entry)
entry = new(std::nothrow) DIESharedType; entry = new(std::nothrow) DIESharedType;
break; break;
default: default:
return B_ENTRY_NOT_FOUND;
break; break;
} }
+5 -1
View File
@@ -825,8 +825,12 @@ DwarfFile::_ParseDebugInfoEntry(DataReader& dataReader,
DebugInfoEntry* entry; DebugInfoEntry* entry;
status_t error = fDebugInfoFactory.CreateDebugInfoEntry( status_t error = fDebugInfoFactory.CreateDebugInfoEntry(
abbreviationEntry.Tag(), entry); abbreviationEntry.Tag(), entry);
if (error != B_OK) if (error != B_OK) {
WARNING("Failed to generate entry for tag %lu, code %lu\n",
abbreviationEntry.Tag(), code);
return error; return error;
}
ObjectDeleter<DebugInfoEntry> entryDeleter(entry); ObjectDeleter<DebugInfoEntry> entryDeleter(entry);
TRACE_DIE("%*sentry %p at %lld: %lu, tag: %s (%lu), children: %d\n", TRACE_DIE("%*sentry %p at %lld: %lu, tag: %s (%lu), children: %d\n",