From: Chris Hanson Date: Tue, 17 Sep 2019 06:50:23 +0000 (-0700) Subject: Workaround for inexplicable fatal error on macOS. X-Git-Tag: mit-scheme-pucked-10.1.20~11^2~49 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=689da8bf97534063f1800caf544a694de81d511e;p=mit-scheme.git Workaround for inexplicable fatal error on macOS. --- diff --git a/src/microcode/cmpintmd/x86-64.c b/src/microcode/cmpintmd/x86-64.c index 84b9f6214..8edfd8baa 100644 --- a/src/microcode/cmpintmd/x86-64.c +++ b/src/microcode/cmpintmd/x86-64.c @@ -224,24 +224,26 @@ write_uuo_target (insn_t * target, SCHEME_OBJECT * saddr) But if the target is a compiled closure pointing into a block somewhere else, the block may not have been relocated yet and so we don't know where the PC will be in the newspace. */ - if ((((int64_t *) (newspace_to_tospace (target)))[-1]) == 0) - { - ptrdiff_t jmprel32_offset = (target - (&addr[15])); - if ((INT32_MIN <= jmprel32_offset) && (jmprel32_offset <= INT32_MAX)) - { - (addr[10]) = 0xe9; /* JMP rel32 */ - (* ((int32_t *) (&addr[11]))) = jmprel32_offset; - } - else - { - (addr[10]) = 0x48; /* MOV RAX,imm64 */ - (addr[11]) = 0xb8; - (* ((insn_t **) (&addr[12]))) = target; - (addr[20]) = 0xff; /* JMP RAX */ - (addr[21]) = 0xe0; - } - } - else + + // **** For unknown reasons this optimization doesn't work right on macOS. + // if ((((int64_t *) (newspace_to_tospace (target)))[-1]) == 0) + // { + // ptrdiff_t jmprel32_offset = (target - (&addr[15])); + // if ((INT32_MIN <= jmprel32_offset) && (jmprel32_offset <= INT32_MAX)) + // { + // (addr[10]) = 0xe9; /* JMP rel32 */ + // (* ((int32_t *) (&addr[11]))) = jmprel32_offset; + // } + // else + // { + // (addr[10]) = 0x48; /* MOV RAX,imm64 */ + // (addr[11]) = 0xb8; + // (* ((insn_t **) (&addr[12]))) = target; + // (addr[20]) = 0xff; /* JMP RAX */ + // (addr[21]) = 0xe0; + // } + // } + // else { (addr[10]) = 0x48; /* MOV RAX,-8(RCX) */ (addr[11]) = 0x8b;