llama : cast seq_id in comparison with unsigned n_seq_max

This commit is contained in:
Francis Couture-Harpin 2024-07-27 15:50:23 -04:00
parent ffd5117def
commit 9cddd9aeec

View file

@ -17674,7 +17674,7 @@ struct llama_data_read {
llama_seq_id seq_id; llama_seq_id seq_id;
read_to(&seq_id, sizeof(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)); 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; return false;
} }