Fix 8k alignment mask computation

This commit is contained in:
Chris Eagle 2015-08-24 00:41:56 -07:00
parent 055dc25633
commit 73bc268036
1 changed files with 2 additions and 2 deletions

4
uc.c Normal file → Executable file
View File

@ -553,8 +553,8 @@ uc_err uc_mem_map(uch handle, uint64_t address, size_t size)
return UC_ERR_UCH;
// align to 8KB boundary
map_begin[map_count] = address & (~ (8*1024));
s = (size + 8*1024 - 1) & (~ (8*1024));
map_begin[map_count] = address & (~ (8*1024 - 1));
s = (size + 8*1024 - 1) & (~ (8*1024 - 1));
map_end[map_count] = s + map_begin[map_count];
uc->memory_map(uc, map_begin[map_count], s);
map_count++;