Fix #8729.
- 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:
@@ -2697,6 +2697,7 @@ DebugInfoEntryFactory::CreateDebugInfoEntry(uint16 tag, DebugInfoEntry*& _entry)
|
||||
entry = new(std::nothrow) DIESharedType;
|
||||
break;
|
||||
default:
|
||||
return B_ENTRY_NOT_FOUND;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -825,8 +825,12 @@ DwarfFile::_ParseDebugInfoEntry(DataReader& dataReader,
|
||||
DebugInfoEntry* entry;
|
||||
status_t error = fDebugInfoFactory.CreateDebugInfoEntry(
|
||||
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;
|
||||
}
|
||||
|
||||
ObjectDeleter<DebugInfoEntry> entryDeleter(entry);
|
||||
|
||||
TRACE_DIE("%*sentry %p at %lld: %lu, tag: %s (%lu), children: %d\n",
|
||||
|
||||
Reference in New Issue
Block a user