| Submitter | Riku Voipio |
|---|---|
| Date | March 26, 2010, 3:25 p.m. |
| Message ID | <52e932ccb17304f60def454d2154726c972bacb6.1269616764.git.riku.voipio@nokia.com> |
| Download | mbox | patch |
| Permalink | /patch/48654/ |
| State | New |
| Headers | show |
Comments
On 03/26/2010 08:25 AM, Riku Voipio wrote: > + if (len == 0) { > + return 0; > + } This part is ok. > > - if (start + len - 1 < start) { > + if (start + len < start) { This part re-introduces the bug I fixed. start = 0xffffff00 len = 256 should succeed, and it won't reverting the (len-1) change. r~
Patch
diff --git a/exec.c b/exec.c index 14767b7..c834be2 100644 --- a/exec.c +++ b/exec.c @@ -2409,8 +2409,11 @@ int page_check_range(target_ulong start, target_ulong len, int flags) #if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS assert(start < ((abi_ulong)1 << L1_MAP_ADDR_SPACE_BITS)); #endif + if (len == 0) { + return 0; + } - if (start + len - 1 < start) { + if (start + len < start) { /* We've wrapped around. */ return -1; }