Project

General

Profile

Actions

Emulator Issues #2448

closed

Infinite loop on memory search

Added by GameZelda2 almost 15 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 #1

Updated by skidau almost 15 years ago

  • Issue type set to Bug
  • Category set to logic
Actions #2

Updated by antidote.crk over 14 years ago

that's because interdpth has a horrible programming style, don't EVER use that style
if you want readability

Actions #3

Updated by nitsuja- over 14 years ago

  • Status changed from New to Fixed

maybe fixed

Actions

Also available in: Atom PDF