From d9a5f670bb6075177a84d0641e05ee25ca9f1727 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 23 May 2021 12:17:34 +0200 Subject: 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. --- gcc/rust/rust-buffered-queue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') 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 -- cgit v1.1