radiance 1.0.0

This commit is contained in:
Deadcode committed 2026-10-04 12:02:41 +02:00
commit ae74a8aebf
616 files changed
+338692

No files matched your search

@@ -0,0 +1,17 @@
--- a/src/unicode.cpp
+++ b/src/unicode.cpp
@@ -58,6 +58,14 @@
throw std::invalid_argument("invalid character");
}
auto result = ((utf8[offset + 0] & 0x07) << 18) | ((utf8[offset + 1] & 0x3f) << 12) | ((utf8[offset + 2] & 0x3f) << 6) | (utf8[offset + 3] & 0x3f);
+ // RADIANCE: lead bytes 0xF5..0xF7 decode above U+10FFFF, which unicode_cpt_to_utf8()
+ // then refuses with a throw that nothing catches -- so four arbitrary bytes in a prompt
+ // terminate the process. Rejecting here instead routes it through the invalid_argument
+ // that unicode_cpts_from_utf8() already turns into U+FFFD. Only the out-of-range case
+ // changes; every sequence upstream accepts still decodes to the same codepoint.
+ if (result > 0x10ffff) {
+ throw std::invalid_argument("invalid character");
+ }
offset += 4;
return result;
}