ppsspp
ppsspp copied to clipboard
Strange for loop in Debugger WebSocketDisasmState::Disasm
@hrydgard, I am confused by this cycle, unless stop is equal to end, and end is equal to next. It will only be executed once, am I right?
https://github.com/hrydgard/ppsspp/blob/d0afdcd94f1ce5346772b45ab9a45dd62498680d/Core/Debugger/WebSocket/DisasmSubscriber.cpp#L343-L345
full code:
https://github.com/hrydgard/ppsspp/blob/d0afdcd94f1ce5346772b45ab9a45dd62498680d/Core/Debugger/WebSocket/DisasmSubscriber.cpp#L333-L345
Assuming the assignment end = disasm_.getNthNextAddress(end, 1)
does not make end
less than it used to be, the expression end >= next
is always evaluated to true
(during the first check it's equal to next
, so it also holds).
So what I see is for (end = initial_value; end < stopping_value; end = next_value())
. So it depends on what the method getNthNextAddress
does. I don't see why it should execute only once.