about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorJan-Mirko Otter <janmirko.otter@googlemail.com>2023-07-01 23:58:47 +0200
committerJan-Mirko Otter <janmirko.otter@googlemail.com>2023-07-01 23:59:21 +0200
commit3ed2b46f2867ee3f5684c0e0617d814eedc2a47d (patch)
tree9652558f47a97e6ac86cbb7c8add44993c1da0e2 /src/tools
parent7905eff5f7c26da8e1aa7880f5e01f395e2e3c05 (diff)
downloadrust-3ed2b46f2867ee3f5684c0e0617d814eedc2a47d.tar.gz
rust-3ed2b46f2867ee3f5684c0e0617d814eedc2a47d.zip
fix compiletest crash
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/compiletest/src/read2.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/compiletest/src/read2.rs b/src/tools/compiletest/src/read2.rs
index 725f7a1515c..a455a1badc0 100644
--- a/src/tools/compiletest/src/read2.rs
+++ b/src/tools/compiletest/src/read2.rs
@@ -83,7 +83,7 @@ impl ProcOutput {
                 }
 
                 let new_len = bytes.len();
-                if *filtered_len <= HEAD_LEN + TAIL_LEN {
+                if (*filtered_len).min(new_len) <= HEAD_LEN + TAIL_LEN {
                     return;
                 }