sync vfasl repair
original commit: b234ef2f5cb8352b9755b2cc908d562a25d18c62
This commit is contained in:
parent
a0e9eed93f
commit
69b92a0ca4
29
c/vfasl.c
29
c/vfasl.c
|
@ -321,11 +321,11 @@ ptr S_vfasl(ptr bv, void *stream, iptr offset, iptr input_len)
|
||||||
} while (0)
|
} while (0)
|
||||||
#define SPACE_PTR(off) ptr_add(vspaces[s2], (off) - offset2)
|
#define SPACE_PTR(off) ptr_add(vspaces[s2], (off) - offset2)
|
||||||
|
|
||||||
/* Fix up pointers. The initiaal content has all pointers relative to
|
/* Fix up pointers. The initial content has all pointers relative to
|
||||||
the start of the data. In not-to-static mode, we can just add the
|
the start of the data. Since the spaces of referenced pointers
|
||||||
`data` address to all pointers. In to-static mode, since the
|
may be discontiguous, use `find_pointer_from_offset` to get each
|
||||||
spaces may be discontiguous, use `find_pointer_from_offset`. */
|
new pointer. */
|
||||||
if (to_static) {
|
{
|
||||||
SPACE_OFFSET_DECLS;
|
SPACE_OFFSET_DECLS;
|
||||||
uptr p_off = 0;
|
uptr p_off = 0;
|
||||||
while (bm != bm_end) {
|
while (bm != bm_end) {
|
||||||
|
@ -351,25 +351,6 @@ ptr S_vfasl(ptr bv, void *stream, iptr offset, iptr input_len)
|
||||||
# undef MAYBE_FIXUP
|
# undef MAYBE_FIXUP
|
||||||
bm++;
|
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().
|
/* Replace references to singletons like "" and #vu8().
|
||||||
|
|
|
@ -1602,7 +1602,7 @@
|
||||||
(on-reset (delete-file out-file #f)
|
(on-reset (delete-file out-file #f)
|
||||||
(on-reset (close-port op)
|
(on-reset (close-port op)
|
||||||
(when bootfile*
|
(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))])
|
(let ([ip ($open-file-input-port who in-file (file-options compressed))])
|
||||||
(on-reset (close-port ip)
|
(on-reset (close-port ip)
|
||||||
(let* ([write-out (lambda (x)
|
(let* ([write-out (lambda (x)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user