sync vfasl repair

original commit: b234ef2f5cb8352b9755b2cc908d562a25d18c62
This commit is contained in:
Matthew Flatt 2018-12-28 21:20:54 -06:00
parent a0e9eed93f
commit 69b92a0ca4
2 changed files with 6 additions and 25 deletions

View File

@ -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().

View File

@ -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)