From 9cddd9aeecdbb1c7f191b930a6acd598ae627556 Mon Sep 17 00:00:00 2001 From: Francis Couture-Harpin Date: Sat, 27 Jul 2024 15:50:23 -0400 Subject: [PATCH] llama : cast seq_id in comparison with unsigned n_seq_max --- src/llama.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llama.cpp b/src/llama.cpp index ba131951c..3f37b2dcf 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -17674,7 +17674,7 @@ struct llama_data_read { llama_seq_id seq_id; read_to(&seq_id, sizeof(seq_id)); - if (seq_id < 0 || seq_id >= llama_n_seq_max(ctx)) { + if (seq_id < 0 || (uint32_t) seq_id >= llama_n_seq_max(ctx)) { LLAMA_LOG_ERROR("%s: invalid seq_id, %d is out of range [0, %u)\n", __func__, seq_id, llama_n_seq_max(ctx)); return false; }