Clear the symbol map between each test.

This way we could, for example, test function replacement properly.

Actually slows down tests because it spends more time correctly
determining the function boundaries.
This commit is contained in:
Unknown W. Brackets committed 2014-03-02 10:20:40 -08:00
1 parent 8f90681994
commit e3506ead69
2 files changed
+13 -6

No files matched your search

+10 -4
View File
@@ -615,15 +615,21 @@ void SymbolMap::AssignFunctionIndices() {
void SymbolMap::UpdateActiveSymbols() {
// return; (slow in debug mode)
lock_guard guard(lock_);
std::map<int, u32> activeModuleIndexes;
for (auto it = activeModuleEnds.begin(), end = activeModuleEnds.end(); it != end; ++it) {
activeModuleIndexes[it->second.index] = it->second.start;
}
activeFunctions.clear();
activeLabels.clear();
activeData.clear();
// On startup and shutdown, we can skip the rest. Tiny optimization.
if (activeModuleEnds.empty() || (functions.empty() && labels.empty() && data.empty())) {
return;
}
std::map<int, u32> activeModuleIndexes;
for (auto it = activeModuleEnds.begin(), end = activeModuleEnds.end(); it != end; ++it) {
activeModuleIndexes[it->second.index] = it->second.start;
}
for (auto it = functions.begin(), end = functions.end(); it != end; ++it) {
const auto mod = activeModuleIndexes.find(it->second.module);
if (it->second.module == 0) {