File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -1150,16 +1150,15 @@ std::list<std::string> PCSX::Widgets::Assembly::findSymbol(uint32_t addr) {
1150
1150
}
1151
1151
1152
1152
std::optional<std::string> PCSX::Widgets::Assembly::findPreviousSymbol (uint32_t addr) {
1153
- std::optional<std::string> ret;
1154
- for (auto & symbol : g_emulator->m_cpu ->m_symbols ) {
1155
- if (symbol.first >= addr) {
1156
- break ;
1157
- }
1158
- if (symbol.first >= m_ramBase) {
1159
- ret = symbol.second ;
1153
+ auto & symbols = g_emulator->m_cpu ->m_symbols ;
1154
+ auto symBeforeAddr = symbols.lower_bound (addr);
1155
+ if (symBeforeAddr != symbols.begin ()) { // verify there is actually a symbol before addr
1156
+ symBeforeAddr--;
1157
+ if (symBeforeAddr->first < addr && symBeforeAddr->first >= m_ramBase) {
1158
+ return symBeforeAddr->second ;
1160
1159
}
1161
1160
}
1162
- return ret ;
1161
+ return {} ;
1163
1162
}
1164
1163
1165
1164
void PCSX::Widgets::Assembly::rebuildSymbolsCaches () {
You can’t perform that action at this time.
0 commit comments