Commit graph

4 commits

Author SHA1 Message Date
Douglas Katzman bd7e55d235 Delete scratch files
Some checks are pending
CL-host / ecl (push) Waiting to run
CL-host / clisp (push) Waiting to run
CL-host / ccl (push) Waiting to run
CL-host / cmucl (push) Waiting to run
CL-host / sbcl (push) Waiting to run
CL-host / self (push) Waiting to run
CL-host / compare-xc-host-fasls (ccl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (clisp, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (cmucl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (self, false) (push) Blocked by required conditions
Linux / build (x86, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-unicode, ) (push) Waiting to run
Linux / build (x86-64, --with-mark-region-gc) (push) Waiting to run
Linux / build (x86-64, --with-sb-fasteval --without-sb-eval, fasteval) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, sse4) (push) Waiting to run
Linux / build (x86-64, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-unicode, ) (push) Waiting to run
Linux / build (x86, --with-sb-thread, ) (push) Waiting to run
Mac / build (--without-sb-thread, x86-64) (push) Waiting to run
Mac / build (arm64, --with-mark-region-gc) (push) Waiting to run
Mac / build (arm64, --with-sb-thread) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc) (push) Waiting to run
Mac / build (x86-64, --with-sb-thread) (push) Waiting to run
Windows / build (push) Waiting to run
2024-07-01 01:03:18 -04:00
Christophe Rhodes 9d8da502dc Better handling of 2- and 4-byte external formats
Incrementing the buffer head by 1 (as in the previous commit) is in
general not a good strategy for 2- and 4-byte external formats.
Propagate the unit size of the external format to
stream-decoding-error-and-handle and to the resync-funtion, so that
restarts can advance by an appropriate amount.

In the process, notice various bits of breakage in octet routines for
2- and 4-byte external formats, where the routines assumed that the
subsequence contained an integer number of units, and read off the end
of the provided memory area.  Add checks for this case, and unify the
error signalling behaviour with that in fd-streams.

Add another clump of tests for these things.
2023-11-02 09:35:33 +00:00
Christophe Rhodes cf4d7a4e5c Reimplement :REPLACEMENT external-formats
Don't wrap a handler around every stream or octet function.  Instead,
thread the replacement from the external format through the various
functions all the way to the coding error site, and inline handling a
coding error if a replacement is provided.

In the process, also somewhat unify the behaviour of restarts around
stream and octet encoding- and decoding-errors: provide a USE-VALUE
restart whose argument should be a character, a string, an octet or an
octet sequence, which will be used as a replacement (with encoding or
decoding if necessary) to the operation that caused the error.

Note a couple of TODOs in the process.
2023-11-02 09:35:33 +00:00
Christophe Rhodes 2066d694bf Fix FILE-STRING-LENGTH given encoding errors
Make the external-format size function check the encodability of the
character before returning a size for it; this usually involves
calling a function that we already have.  In a few cases this may lead
to a duplicate call to CHAR-CODE, which is cheap but elidable if
necessary, though this function is only called in FILE-STRING-LENGTH
in any case.

(That's not quite true: it's also called in :UNREAD in fd-stream.lisp,
which is shadowed for FD-STREAMs with buffers, but exposed by
generating an FD-STREAM without a buffer by using :direction :io or
bivalent streams.)
2023-11-02 09:35:33 +00:00