Commit 7221fa98d381a19b8809979934554644381fb88c

Authored by balrog
1 parent 7fbfb139

Check permissions for the last byte first in unaligned slow_st accesses (patch from TeLeMan).


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3665 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 1 additions and 1 deletions
softmmu_template.h
... ... @@ -282,7 +282,7 @@ static void glue(glue(slow_st, SUFFIX), MMUSUFFIX)(target_ulong addr,
282 282 } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) {
283 283 do_unaligned_access:
284 284 /* XXX: not efficient, but simple */
285   - for(i = 0;i < DATA_SIZE; i++) {
  285 + for(i = DATA_SIZE - 1; i >= 0; i--) {
286 286 #ifdef TARGET_WORDS_BIGENDIAN
287 287 glue(slow_stb, MMUSUFFIX)(addr + i, val >> (((DATA_SIZE - 1) * 8) - (i * 8)),
288 288 mmu_idx, retaddr);
... ...