aboutsummaryrefslogtreecommitdiff
path: root/src/display/display_sink.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2024-06-23 21:54:03 -0700
committeriximeow <me@iximeow.net>2024-06-23 21:54:03 -0700
commit01fe27a77a08c932b6457f1621796a57e6b866d7 (patch)
tree65df47e121eba5bd934ae1338c6f37e01787638a /src/display/display_sink.rs
parentd0b9925bc1f75949f54d5290edfda4bf9ecd7bba (diff)
fix InstructionTextSink panicking in write_char
Diffstat (limited to 'src/display/display_sink.rs')
-rw-r--r--src/display/display_sink.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/display/display_sink.rs b/src/display/display_sink.rs
index f5ec026..e83f084 100644
--- a/src/display/display_sink.rs
+++ b/src/display/display_sink.rs
@@ -453,7 +453,9 @@ mod instruction_text_sink {
// write single ASCII characters. this is wrong in the general case, but `write_char`
// here is not going to be used in the general case.
if cfg!(debug_assertions) {
- panic!("InstructionTextSink::write_char would truncate output");
+ if c > '\x7f' {
+ panic!("InstructionTextSink::write_char would truncate output");
+ }
}
let to_push = c as u8;
// `ptr::write` here because `underlying.add(underlying.len())` may not point to an