common : fixed critical UB inserting map size into himself
More info: https://stackoverflow.com/questions/61546383/is-inserting-map-size-as-value-into-a-map-undefined-behavior
This commit is contained in:
parent
0d4177126b
commit
c7d0b67a80
1 changed files with 3 additions and 1 deletions
|
@ -1774,7 +1774,9 @@ 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; }
|
||||
seqs[cs_curr[j]] = seqs.size();
|
||||
seqs[cs_curr[j]] = 0;
|
||||
const auto size = seqs.size();
|
||||
seqs[cs_curr[j]] = size;
|
||||
}
|
||||
}
|
||||
if (seqs.size() + 1 >= sizeof(slot_chars)) { break; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue