Tweaks to the tweaks.

SDB needs a rewrite.
This commit is contained in:
Ben Vanik 2013-01-31 22:00:43 -08:00
parent 837a414249
commit e8dd27f490
1 changed files with 7 additions and 2 deletions

View File

@ -165,6 +165,7 @@ int SymbolDatabase::Analyze() {
// This can only be performed after we have all functions and basic blocks. // This can only be performed after we have all functions and basic blocks.
bool needs_another_pass = false; bool needs_another_pass = false;
do { do {
needs_another_pass = false;
for (SymbolMap::iterator it = symbols_.begin(); it != symbols_.end(); for (SymbolMap::iterator it = symbols_.begin(); it != symbols_.end();
++it) { ++it) {
if (it->second->symbol_type == Symbol::Function) { if (it->second->symbol_type == Symbol::Function) {
@ -736,13 +737,17 @@ bool SymbolDatabase::FillHoles() {
} }
} }
bool any_functions_added = false;
for (std::vector<HoleInfo>::iterator it = holes.begin(); it != holes.end(); for (std::vector<HoleInfo>::iterator it = holes.begin(); it != holes.end();
++it) { ++it) {
FunctionSymbol* fn = GetOrInsertFunction(it->start_address); 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() { int SymbolDatabase::FlushQueue() {