Add comment regarding fixed UB

This commit is contained in:
Michael Klimenko 2024-01-28 16:43:11 +01:00
parent c35004b90d
commit fcfdc56cc2

View file

@ -1700,6 +1700,7 @@ void dump_kv_cache_view_seqs(const llama_kv_cache_view & view, int row_size) {
if (cs_curr[j] < 0) { continue; }
if (seqs.find(cs_curr[j]) == seqs.end()) {
if (seqs.size() + 1 >= sizeof(slot_chars)) { break; }
// combining the following two lines will result in an UB: https://pvs-studio.com/en/docs/warnings/v708/
auto current_size = seqs.size();
seqs[cs_curr[j]] = current_size;
}