comparison backend_x86.c @ 2036:45c4b74e7676

Fix bug in handling of MMAP_CODE regions smaller than 16KB
author Michael Pavone <pavone@retrodev.com>
date Sun, 07 Mar 2021 22:43:51 -0800
parents 2a5649a767e7
children 8ee7ecbf3f21
comparison
equal deleted inserted replaced
2035:33f454232aee 2036:45c4b74e7676
297 mov_ir(code, size == SZ_B ? 0xFF : 0xFFFF, opts->scratch1, size); 297 mov_ir(code, size == SZ_B ? 0xFF : 0xFFFF, opts->scratch1, size);
298 } 298 }
299 retn(code); 299 retn(code);
300 } 300 }
301 if (memmap[chunk].flags & MMAP_CODE) { 301 if (memmap[chunk].flags & MMAP_CODE) {
302 uint32_t added_offset;
302 if (memmap[chunk].mask == opts->address_mask) { 303 if (memmap[chunk].mask == opts->address_mask) {
303 ram_flags_off += (memmap[chunk].end - memmap[chunk].start) / (1 << opts->ram_flags_shift) / 8; ; 304 added_offset = (memmap[chunk].end - memmap[chunk].start) / (1 << opts->ram_flags_shift) / 8;
304 } else { 305 } else {
305 ram_flags_off += (memmap[chunk].mask + 1) / (1 << opts->ram_flags_shift) / 8;; 306 added_offset = (memmap[chunk].mask + 1) / (1 << opts->ram_flags_shift) / 8;
307 }
308 if (added_offset) {
309 ram_flags_off += added_offset;
310 } else {
311 ram_flags_off += 1;
306 } 312 }
307 } 313 }
308 if (lb_jcc) { 314 if (lb_jcc) {
309 *lb_jcc = code->cur - (lb_jcc+1); 315 *lb_jcc = code->cur - (lb_jcc+1);
310 lb_jcc = NULL; 316 lb_jcc = NULL;