n64 - fix crash when attempting to read the PC register on frame 0, solved on the c++ side with a null pointer check and a default value returned.
This commit is contained in:
parent
69c66d12b1
commit
96e91e7093
|
@ -1111,8 +1111,19 @@ EXPORT void CALL GetRegisters(unsigned char * dest)
|
|||
{
|
||||
memcpy(dest, reg, 8 * 32);
|
||||
dest += 8 * 32;
|
||||
memcpy(dest, &(PC->addr), 4);
|
||||
|
||||
if (PC != NULL)
|
||||
{
|
||||
memcpy(dest, &(PC->addr), 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
char stupid[] = "0000";
|
||||
memcpy(dest, stupid, 4);
|
||||
}
|
||||
|
||||
dest += 4;
|
||||
|
||||
memcpy(dest, &llbit, 4);
|
||||
dest += 4;
|
||||
memcpy(dest, &lo, 8);
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue