Fixed a crash when adding a FunctionSymbol with a NULL address.

This commit is contained in:
Rick Gibbed 2013-06-02 07:57:38 -07:00
parent 105aee506d
commit b97b8226b2
1 changed files with 5 additions and 3 deletions

View File

@ -739,9 +739,11 @@ int XexSymbolDatabase::AddMethodHints() {
for (size_t n = 0; n < entry_count; n++) { for (size_t n = 0; n < entry_count; n++) {
PEMethodInfo* method_info = &method_infos[n]; PEMethodInfo* method_info = &method_infos[n];
if (method_info->address != 0) {
FunctionSymbol* fn = GetOrInsertFunction(method_info->address); FunctionSymbol* fn = GetOrInsertFunction(method_info->address);
fn->end_address = method_info->address + method_info->total_length - 4; fn->end_address = method_info->address + method_info->total_length - 4;
fn->type = FunctionSymbol::User; fn->type = FunctionSymbol::User;
}
// TODO(benvanik): something with prolog_length? // TODO(benvanik): something with prolog_length?
} }