Browse Source
fix
Signed-off-by: lizzie <lizzie@eden-emu.dev>
pull/2866/head
lizzie
3 months ago
No known key found for this signature in database
GPG Key ID: 287378CADCAB13
2 changed files with
4 additions and
4 deletions
-
src/dynarmic/src/dynarmic/backend/arm64/devirtualize.h
-
src/dynarmic/src/dynarmic/backend/x64/devirtualize.h
|
|
|
@ -42,8 +42,8 @@ DevirtualizedCall DevirtualizeDefault(mcl::class_type<decltype(mfp)>* this_) { |
|
|
|
u64 fn_ptr = mfp_struct.ptr; |
|
|
|
u64 this_ptr = std::bit_cast<u64>(this_) + (mfp_struct.adj >> 1); |
|
|
|
if (mfp_struct.adj & 1) { |
|
|
|
u64 vtable = std::bit_cast_pointee<u64>(this_ptr); |
|
|
|
fn_ptr = std::bit_cast_pointee<u64>(vtable + fn_ptr); |
|
|
|
u64 vtable = *reinterpret_cast<u64 const*>(this_ptr); |
|
|
|
fn_ptr = *reinterpret_cast<u64 const*>(vtable + fn_ptr); |
|
|
|
} |
|
|
|
return DevirtualizedCall{fn_ptr, this_ptr}; |
|
|
|
} |
|
|
|
|
|
|
|
@ -61,8 +61,8 @@ ArgCallback DevirtualizeItanium(mcl::class_type<decltype(mfp)>* this_) { |
|
|
|
u64 fn_ptr = mfp_struct.ptr; |
|
|
|
u64 this_ptr = reinterpret_cast<u64>(this_) + mfp_struct.adj; |
|
|
|
if (mfp_struct.ptr & 1) { |
|
|
|
u64 vtable = std::bit_cast_pointee<u64>(this_ptr); |
|
|
|
fn_ptr = std::bit_cast_pointee<u64>(vtable + fn_ptr - 1); |
|
|
|
u64 vtable = *reinterpret_cast<u64 const*>(this_ptr); |
|
|
|
fn_ptr = *reinterpret_cast<u64 const*>(vtable + fn_ptr - 1); |
|
|
|
} |
|
|
|
return ArgCallback{fn_ptr, this_ptr}; |
|
|
|
} |
|
|
|
|