Fix read/write_compiled_closure_target offsets.
authorTaylor R Campbell <campbell@mumble.net>
Sun, 20 Jan 2019 00:18:55 +0000 (00:18 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Wed, 21 Aug 2019 21:34:04 +0000 (21:34 +0000)
src/microcode/cmpintmd/aarch64.c

index 61f267263da3001bd90b84dcf087e3f2028d53f7..4ec526ede41a4f5531589358fb2cf2a15197c444 100644 (file)
@@ -125,7 +125,7 @@ start_closure_relocation (SCHEME_OBJECT * scan, reloc_ref_t * ref)
 insn_t *
 read_compiled_closure_target (insn_t * start, reloc_ref_t * ref)
 {
-  insn_t * addr = (start + CC_ENTRY_HEADER_SIZE);
+  insn_t * addr = (start + CC_ENTRY_PADDING_SIZE + CC_ENTRY_HEADER_SIZE);
   insn_t * base = (tospace_to_newspace (addr));
   /* If we're relocating, find where base was in the oldspace.  */
   if (ref)
@@ -143,7 +143,7 @@ read_compiled_closure_target (insn_t * start, reloc_ref_t * ref)
 void
 write_compiled_closure_target (insn_t * target, insn_t * start)
 {
-  insn_t * addr = (start + CC_ENTRY_HEADER_SIZE);
+  insn_t * addr = (start + CC_ENTRY_PADDING_SIZE + CC_ENTRY_HEADER_SIZE);
   (((int64_t *) addr)[-1]) =
     (target - ((insn_t *) (tospace_to_newspace (addr))));
 }