aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2021-05-23 12:17:34 +0200
committerMarc Poulhiès <dkm@kataplop.net>2021-05-23 16:10:52 +0200
commitd9a5f670bb6075177a84d0641e05ee25ca9f1727 (patch)
tree6b539bc2c6ee277c6cde4b7cc075b52fb8fe9881 /gcc
parent586d1d8066d7c62afaab8cbb44cd2310e8aa138e (diff)
downloadgcc-d9a5f670bb6075177a84d0641e05ee25ca9f1727.zip
gcc-d9a5f670bb6075177a84d0641e05ee25ca9f1727.tar.gz
gcc-d9a5f670bb6075177a84d0641e05ee25ca9f1727.tar.bz2
Fix assert in rust-buffered-queue peek
When end + num_items_to_read > buffer.size the buffer is extended to make sure it can hold at least the extra num_items_to_read. The assert at the end of this block however checks against end + num_queued_items. Fix the assert. This makes check-rust zero fail on arm64.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/rust-buffered-queue.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/rust-buffered-queue.h b/gcc/rust/rust-buffered-queue.h
index ebea02f..be8c0b8 100644
--- a/gcc/rust/rust-buffered-queue.h
+++ b/gcc/rust/rust-buffered-queue.h
@@ -101,7 +101,7 @@ public:
* reallocation upon resizing */
// validate that buffer is large enough now
- rust_assert (end + num_queued_items < (int) buffer.size ());
+ rust_assert (end + num_items_to_read <= (int) buffer.size ());
}
/* iterate through buffer and invoke operator () on source on values