From e8dd27f490c6ffae0194a84749ae54ccf63fa826 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Thu, 31 Jan 2013 22:00:43 -0800 Subject: [PATCH] Tweaks to the tweaks. SDB needs a rewrite. --- src/cpu/sdb.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cpu/sdb.cc b/src/cpu/sdb.cc index 21e5ac978..32b72a130 100644 --- a/src/cpu/sdb.cc +++ b/src/cpu/sdb.cc @@ -165,6 +165,7 @@ int SymbolDatabase::Analyze() { // This can only be performed after we have all functions and basic blocks. bool needs_another_pass = false; do { + needs_another_pass = false; for (SymbolMap::iterator it = symbols_.begin(); it != symbols_.end(); ++it) { if (it->second->symbol_type == Symbol::Function) { @@ -736,13 +737,17 @@ bool SymbolDatabase::FillHoles() { } } + bool any_functions_added = false; for (std::vector::iterator it = holes.begin(); it != holes.end(); ++it) { FunctionSymbol* fn = GetOrInsertFunction(it->start_address); - fn->end_address = it->end_address; + if (!fn->end_address) { + fn->end_address = it->end_address; + any_functions_added = true; + } } - return holes.size() > 0; + return any_functions_added; } int SymbolDatabase::FlushQueue() {