Skip to content

Commit

Permalink
Correct error code for reads into a bad pointer.
Browse files Browse the repository at this point in the history
Per tests this is generally -1.
  • Loading branch information
unknownbrackets committed Mar 2, 2014
1 parent 2a4cbb7 commit d7ba8f7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Core/HLE/sceIo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,10 +764,13 @@ bool __IoRead(int &result, int id, u32 data_addr, int size) {
return true;
}
} else {
ERROR_LOG_REPORT(SCEIO, "sceIoRead Reading into bad pointer %08x", data_addr);
// TODO: Returning 0 because it wasn't being sign-extended in async result before.
// What should this do?
result = 0;
if (size != 0) {
// TODO: For some combinations of bad pointer + size, SCE_KERNEL_ERROR_ILLEGAL_ADDR.
// Seems like only for kernel RAM. For most cases, it really is -1.
result = -1;
} else {
result = 0;
}
return true;
}
} else {
Expand Down

0 comments on commit d7ba8f7

Please sign in to comment.