From 69b92a0ca407a2970f4146ac80e4db80698f17d9 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 28 Dec 2018 21:20:54 -0600 Subject: [PATCH] sync vfasl repair original commit: b234ef2f5cb8352b9755b2cc908d562a25d18c62 --- c/vfasl.c | 29 +++++------------------------ s/compile.ss | 2 +- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/c/vfasl.c b/c/vfasl.c index 48a5f97d9b..d704efa2f7 100644 --- a/c/vfasl.c +++ b/c/vfasl.c @@ -321,11 +321,11 @@ ptr S_vfasl(ptr bv, void *stream, iptr offset, iptr input_len) } while (0) #define SPACE_PTR(off) ptr_add(vspaces[s2], (off) - offset2) - /* Fix up pointers. The initiaal content has all pointers relative to - the start of the data. In not-to-static mode, we can just add the - `data` address to all pointers. In to-static mode, since the - spaces may be discontiguous, use `find_pointer_from_offset`. */ - if (to_static) { + /* Fix up pointers. The initial content has all pointers relative to + the start of the data. Since the spaces of referenced pointers + may be discontiguous, use `find_pointer_from_offset` to get each + new pointer. */ + { SPACE_OFFSET_DECLS; uptr p_off = 0; while (bm != bm_end) { @@ -351,25 +351,6 @@ ptr S_vfasl(ptr bv, void *stream, iptr offset, iptr input_len) # undef MAYBE_FIXUP bm++; } - } else { - ptr *p = (ptr *)data; - while (bm != bm_end) { - octet m = *bm; -# define MAYBE_FIXUP(i) if (m & (1 << i)) p[i] = ptr_add(p[i], (uptr)data) - - MAYBE_FIXUP(0); - MAYBE_FIXUP(1); - MAYBE_FIXUP(2); - MAYBE_FIXUP(3); - MAYBE_FIXUP(4); - MAYBE_FIXUP(5); - MAYBE_FIXUP(6); - MAYBE_FIXUP(7); - -# undef MAYBE_FIXUP - p += byte_bits; - bm++; - } } /* Replace references to singletons like "" and #vu8(). diff --git a/s/compile.ss b/s/compile.ss index 1b6248b74d..606e9e806b 100644 --- a/s/compile.ss +++ b/s/compile.ss @@ -1602,7 +1602,7 @@ (on-reset (delete-file out-file #f) (on-reset (close-port op) (when bootfile* - (emit-boot-header op (constant machine-type) bootfile*)) + (emit-boot-header op (constant machine-type-name) bootfile*)) (let ([ip ($open-file-input-port who in-file (file-options compressed))]) (on-reset (close-port ip) (let* ([write-out (lambda (x)