Joseph Ferano ecf3882fa2 Refusing to encode is a claim about the buffer, and nothing was checking it
encode-rune! says nothing is written when it answers None, and every None case
in the table passed that claim without testing it: an encoder that lays the
lead byte down and only then notices the buffer is short returns None exactly
as a correct one does. So a known byte goes into scratch, a refused encoding
is asked for, and the byte is read back. Storing before the length test turns
the line from 65 -1 65 -1 65 into 65 -1 0 -1 0.

The read-only claim beside lower-ascii was reasoned from the emitted linkage
rather than observed, and observing it was worse than the guess. With
(set (at (bytes "Hi") 0) \h): at -O0 the store is emitted against the constant
and the program takes SIGSEGV; at -O2 LLVM deletes it as undefined behaviour
and the program prints "Hi" and exits 0. The same source either dies or
silently does nothing depending on a flag. The comment now says that instead
of predicting a segfault.
2026-09-12 04:01:25 +07:00
..
2026-09-10 17:41:06 +07:00
2026-09-10 17:27:53 +07:00
2026-09-11 20:11:01 +07:00
2026-09-11 20:11:01 +07:00
2026-09-11 20:11:01 +07:00
2026-09-11 20:11:01 +07:00
2026-09-11 20:11:01 +07:00
2026-09-10 17:27:53 +07:00
2026-09-10 17:27:53 +07:00