comparison backend_x86.c @ 1511:2a5649a767e7

Fix accidental add to RSP with SZ_D and SZ_PTR. Using SZ_D breakse when the stack is located outside of the 32-bit addressable range
author Michael Pavone <pavone@retrodev.com>
date Sun, 31 Dec 2017 14:08:47 -0800
parents 5d41d0574863
children 45c4b74e7676
comparison
equal deleted inserted replaced
1505:f5d693bd694a 1511:2a5649a767e7
242 add_rdispr(code, RSP, 0, opts->scratch2, SZ_PTR); 242 add_rdispr(code, RSP, 0, opts->scratch2, SZ_PTR);
243 mov_rrind(code, opts->scratch1, opts->scratch2, tmp_size); 243 mov_rrind(code, opts->scratch1, opts->scratch2, tmp_size);
244 if (is_write && (memmap[chunk].flags & MMAP_CODE)) { 244 if (is_write && (memmap[chunk].flags & MMAP_CODE)) {
245 pop_r(code, opts->scratch2); 245 pop_r(code, opts->scratch2);
246 } else { 246 } else {
247 add_ir(code, sizeof(void*), RSP, SZ_D); 247 add_ir(code, sizeof(void*), RSP, SZ_PTR);
248 code->stack_off -= sizeof(void *); 248 code->stack_off -= sizeof(void *);
249 } 249 }
250 } else { 250 } else {
251 push_r(code, opts->scratch2); 251 push_r(code, opts->scratch2);
252 mov_ir(code, (intptr_t)memmap[chunk].buffer, opts->scratch2, SZ_PTR); 252 mov_ir(code, (intptr_t)memmap[chunk].buffer, opts->scratch2, SZ_PTR);