From b97b8226b2f95ce02dadd544bcbc520d881d596d Mon Sep 17 00:00:00 2001 From: Rick Gibbed Date: Sun, 2 Jun 2013 07:57:38 -0700 Subject: [PATCH] Fixed a crash when adding a FunctionSymbol with a NULL address. --- src/xenia/cpu/sdb/xex_symbol_database.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/xenia/cpu/sdb/xex_symbol_database.cc b/src/xenia/cpu/sdb/xex_symbol_database.cc index 2e1de914d..dd9835754 100644 --- a/src/xenia/cpu/sdb/xex_symbol_database.cc +++ b/src/xenia/cpu/sdb/xex_symbol_database.cc @@ -739,9 +739,11 @@ int XexSymbolDatabase::AddMethodHints() { for (size_t n = 0; n < entry_count; n++) { PEMethodInfo* method_info = &method_infos[n]; - FunctionSymbol* fn = GetOrInsertFunction(method_info->address); - fn->end_address = method_info->address + method_info->total_length - 4; - fn->type = FunctionSymbol::User; + if (method_info->address != 0) { + FunctionSymbol* fn = GetOrInsertFunction(method_info->address); + fn->end_address = method_info->address + method_info->total_length - 4; + fn->type = FunctionSymbol::User; + } // TODO(benvanik): something with prolog_length? }