From 5b888f0d0ae558dd31f473a7078d50a52769b9db Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 16 Oct 2013 00:56:46 -0700 Subject: [PATCH] Fix a crash in debug mode with no threads. --- Windows/Debugger/Debugger_Lists.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Windows/Debugger/Debugger_Lists.cpp b/Windows/Debugger/Debugger_Lists.cpp index fc451a0e90..67e436e0fb 100644 --- a/Windows/Debugger/Debugger_Lists.cpp +++ b/Windows/Debugger/Debugger_Lists.cpp @@ -661,7 +661,7 @@ void CtrlStackTraceView::loadStackTrace() { auto threads = GetThreadsInfo(); - u32 entry, stackTop; + u32 entry = 0, stackTop = 0; for (size_t i = 0; i < threads.size(); i++) { if (threads[i].isCurrent) @@ -672,6 +672,10 @@ void CtrlStackTraceView::loadStackTrace() } } - frames = MIPSStackWalk::Walk(cpu->GetPC(),cpu->GetRegValue(0,31),cpu->GetRegValue(0,29),entry,stackTop); + if (entry != 0) { + frames = MIPSStackWalk::Walk(cpu->GetPC(),cpu->GetRegValue(0,31),cpu->GetRegValue(0,29),entry,stackTop); + } else { + frames.clear(); + } Update(); }