Emulator Issues #2448
closedInfinite loop on memory search
0%
Description
What steps will reproduce the problem?
- Load Dolphin (debug mode).
- Go to the "Memory" window (View -> Memory).
- Search for any value that isn't in the memory.
What is the expected output? What do you see instead?
Expected: The emulator tells me that the value isn't in the memory.
Real: The emulator "hangs" (infinite loop).
What version of the product are you using? On what operating system?
2.0 RC1 DebugFast. Windows XP, but it shouldn't matter.
Please provide any additional information below.
The loop causing the infinite loop is on:
"stable/Source/Core/DebuggerWX/Src/MemoryWindow.cpp", line 391
Loop declaration: "for(;szRAM;i++){"
If you look at the body of the loop, it's clear that the loop only exits if
a match is found.
I believe the bug was that the programmer thought the line:
"if(i+k>szRAM) break;"
would exit the loop, but it doesn't, since it's in the inner loop.
I think this line should be removed and instead add a check to the
declaration of the outer loop, "i + size > szRam" (not tested).
BTW, the code before it looks a bit messy.