# HG changeset patch # User Michael Pavone # Date 1475771143 25200 # Node ID 89cc20cf1ad374f72e9a002480b52ad015083ef3 # Parent 38261413091418ad935fae8543ccdbfe7f6bfb08 Fix handling of MMAP_CODE chunks that also have MMAP_PTR_IDX set diff -r 382614130914 -r 89cc20cf1ad3 backend_x86.c --- a/backend_x86.c Tue Oct 04 18:30:49 2016 -0700 +++ b/backend_x86.c Thu Oct 06 09:25:43 2016 -0700 @@ -141,10 +141,15 @@ if (opts->address_size != SZ_D) { movzx_rr(code, adr_reg, adr_reg, opts->address_size, SZ_D); } + if (is_write && (memmap[chunk].flags & MMAP_CODE)) { + push_r(code, adr_reg); + } add_rdispr(code, opts->context_reg, opts->mem_ptr_off + sizeof(void*) * memmap[chunk].ptr_index, adr_reg, SZ_PTR); if (is_write) { mov_rrind(code, opts->scratch1, opts->scratch2, size); - + if (memmap[chunk].flags & MMAP_CODE) { + pop_r(code, adr_reg); + } } else { mov_rindr(code, opts->scratch1, opts->scratch1, size); }