mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-11 08:35:36 +00:00
tcg: Fix off-by-one in assert in page_set_flags
Most of the users of page_set_flags offset (page, page + len) as the end points. One might consider this an error, since the other users do supply an endpoint as the last byte of the region. However, the first thing that page_set_flags does is round end UP to the start of the next page. Which means computing page + len - 1 is in the end pointless. Therefore, accept this usage and do not assert when given the exact size of the vm as the endpoint. Backports commit de258eb07db6cf893ef1bfad8c0cedc0b983db55 from qemu
This commit is contained in:
parent
6f265062ef
commit
c897ba3e2c
|
@ -2117,7 +2117,7 @@ static void page_set_flags(struct uc_struct *uc, target_ulong start, target_ulon
|
|||
guest address space. If this assert fires, it probably indicates
|
||||
a missing call to h2g_valid. */
|
||||
#if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS
|
||||
assert(end < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS));
|
||||
assert(end <= ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS));
|
||||
#endif
|
||||
assert(start < end);
|
||||
|
||||
|
|
Loading…
Reference in a new issue