mirror of
https://github.com/izzy2lost/xenia-edge.git
synced 2026-07-06 00:20:26 -07:00
[CPU] Check for null when returning machine code ptr
This commit is contained in:
@@ -120,8 +120,12 @@ uintptr_t GuestFunction::MapGuestAddressToMachineCode(
|
||||
|
||||
uint32_t GuestFunction::MapMachineCodeToGuestAddress(
|
||||
uintptr_t host_address) const {
|
||||
auto entry = LookupMachineCodeOffset(static_cast<uint32_t>(
|
||||
host_address - reinterpret_cast<uintptr_t>(machine_code())));
|
||||
void* code = machine_code();
|
||||
if (!code) {
|
||||
return address();
|
||||
}
|
||||
auto entry = LookupMachineCodeOffset(
|
||||
static_cast<uint32_t>(host_address - reinterpret_cast<uintptr_t>(code)));
|
||||
return entry ? entry->guest_address : address();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user