mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-02 08:01:11 +00:00
cputlb: cast size_t to target_ulong before using for address masks
While size_t is defined to happily access the biggest host object this isn't the case when generating masks for 64 bit guests on 32 bit hosts. Otherwise we end up truncating the address when we fall back to our unaligned helper. Fixes: https://bugs.launchpad.net/qemu/+bug/1831545 Backports commit ab7a2009df66241a3742cbdfe8f9a1f66c6af21f from qemu
This commit is contained in:
parent
9aef73f5fb
commit
938f8465a0
|
@ -1088,7 +1088,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
|
|||
uint64_t r1, r2;
|
||||
unsigned shift;
|
||||
do_unaligned_access:
|
||||
addr1 = addr & ~(size - 1);
|
||||
addr1 = addr & ~((target_ulong)size - 1);
|
||||
addr2 = addr1 + size;
|
||||
r1 = full_load(env, addr1, oi, retaddr);
|
||||
r2 = full_load(env, addr2, oi, retaddr);
|
||||
|
|
Loading…
Reference in a new issue