Mercurial > repos > blastem
comparison m68k_to_x86.c @ 561:666adeba5a61
Save and restore guest address in the write function for a code memory chunk in the "slow" path for inconvenient host addresses. This fixes an intermittent crash on OSX in the code that checks whether the memory written may contain code
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 23 Jun 2014 11:46:56 -0400 |
parents | f9431cb3a39c |
children |
comparison
equal
deleted
inserted
replaced
560:f9431cb3a39c | 561:666adeba5a61 |
---|---|
4490 } else { | 4490 } else { |
4491 dst = mov_rdisp32r(dst, SCRATCH1, (intptr_t)memmap[chunk].buffer, SCRATCH1, tmp_size); | 4491 dst = mov_rdisp32r(dst, SCRATCH1, (intptr_t)memmap[chunk].buffer, SCRATCH1, tmp_size); |
4492 } | 4492 } |
4493 } else { | 4493 } else { |
4494 if (is_write) { | 4494 if (is_write) { |
4495 if (memmap[chunk].flags & MMAP_CODE) { | |
4496 dst = push_r(dst, SCRATCH2); | |
4497 } | |
4495 dst = push_r(dst, SCRATCH1); | 4498 dst = push_r(dst, SCRATCH1); |
4496 dst = mov_ir(dst, (intptr_t)memmap[chunk].buffer, SCRATCH1, SZ_PTR); | 4499 dst = mov_ir(dst, (intptr_t)memmap[chunk].buffer, SCRATCH1, SZ_PTR); |
4497 dst = add_rr(dst, SCRATCH1, SCRATCH2, SZ_PTR); | 4500 dst = add_rr(dst, SCRATCH1, SCRATCH2, SZ_PTR); |
4498 dst = pop_r(dst, SCRATCH1); | 4501 dst = pop_r(dst, SCRATCH1); |
4499 dst = mov_rrind(dst, SCRATCH1, SCRATCH2, tmp_size); | 4502 dst = mov_rrind(dst, SCRATCH1, SCRATCH2, tmp_size); |
4503 if (memmap[chunk].flags & MMAP_CODE) { | |
4504 dst = pop_r(dst, SCRATCH2); | |
4505 } | |
4500 } else { | 4506 } else { |
4501 dst = mov_ir(dst, (intptr_t)memmap[chunk].buffer, SCRATCH2, SZ_PTR); | 4507 dst = mov_ir(dst, (intptr_t)memmap[chunk].buffer, SCRATCH2, SZ_PTR); |
4502 dst = mov_rindexr(dst, SCRATCH2, SCRATCH1, 0, SCRATCH1, tmp_size); | 4508 dst = mov_rindexr(dst, SCRATCH2, SCRATCH1, 0, SCRATCH1, tmp_size); |
4503 } | 4509 } |
4504 } | 4510 } |