Project

General

Profile

Actions

Emulator Issues #2448

closed

Infinite loop on memory search

Added by GameZelda2 over 14 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
Logic
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

What steps will reproduce the problem?

  1. Load Dolphin (debug mode).
  2. Go to the "Memory" window (View -> Memory).
  3. 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.

Actions

Also available in: Atom PDF