Skip to content

Commit

Permalink
Debugger: Fix infinite loop in symbol storage (#1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
goeiecool9999 authored Mar 27, 2024
1 parent 4f3d462 commit 5230fca
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Cafe/HW/Espresso/Debugger/DebugSymbolStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,17 @@ class DebugSymbolStorage

static void ClearRange(MPTR address, uint32 length)
{
if (length == 0)
return;
s_lock.lock();
while (length > 0)
for (;;)
{
auto itr = s_typeStorage.find(address);
if (itr != s_typeStorage.end())
s_typeStorage.erase(itr);

if (length <= 4)
break;
address += 4;
length -= 4;
}
Expand All @@ -60,4 +65,4 @@ class DebugSymbolStorage
private:
static FSpinlock s_lock;
static std::unordered_map<MPTR, DEBUG_SYMBOL_TYPE> s_typeStorage;
};
};

0 comments on commit 5230fca

Please sign in to comment.