diff --git a/Source/Core/Core/PowerPC/PPCSymbolDB.cpp b/Source/Core/Core/PowerPC/PPCSymbolDB.cpp index 2d0734270128..3faa273d086a 100644 --- a/Source/Core/Core/PowerPC/PPCSymbolDB.cpp +++ b/Source/Core/Core/PowerPC/PPCSymbolDB.cpp @@ -424,15 +424,25 @@ bool PPCSymbolDB::LoadMap(const Core::CPUThreadGuard& guard, const std::string& { // If it does, the symbol is likely demangled, so look for the end of the name size_t nameEndOffset = parenthesisOffset; - while (processed_name[nameEndOffset] != ')') + int depth = 0; // Current parenthesis depth + while (true) { + char curChar = processed_name[nameEndOffset]; + if (curChar == '(') + depth++; + else if (curChar == ')') + depth--; + nameEndOffset++; + + if (depth == 0) + break; } nameEndOffset++; // Advance past the ending parenthesis // If the name ends with const, advance past it - if (processed_name.find(") const") != std::string::npos) + if (processed_name.find(") const ") != std::string::npos) { nameEndOffset += 6; }