mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Fix warnings: syntax.c: get_id_list(): Double free: FP.
Problem : Double free @ 5213.
Diagnostic : False positive.
Rationale : I haven't been able to find the real reason why this is
signaled. Nonetheless, I've been able to track down the
introduction of this warning to commit
77135447e0
.
The change there affecting this function is just a
transformation maintaining semantics. So, this must be a
FP, though I can't explain why.
Resolution : Revert changes in mentioned commmit touching this function.
This commit is contained in:
parent
693da00920
commit
885661d25b
@ -5157,22 +5157,21 @@ get_id_list (
|
||||
regmatch.rm_ic = TRUE;
|
||||
id = 0;
|
||||
for (int i = highlight_ga.ga_len; --i >= 0; ) {
|
||||
if (!vim_regexec(®match, HL_TABLE()[i].sg_name, (colnr_T)0)) {
|
||||
continue;
|
||||
if (vim_regexec(®match, HL_TABLE()[i].sg_name, (colnr_T)0)) {
|
||||
if (round == 2) {
|
||||
/* Got more items than expected; can happen
|
||||
* when adding items that match:
|
||||
* "contains=a.*b,axb".
|
||||
* Go back to first round */
|
||||
if (count >= total_count) {
|
||||
free(retval);
|
||||
round = 1;
|
||||
} else
|
||||
retval[count] = i + 1;
|
||||
}
|
||||
++count;
|
||||
id = -1; /* remember that we found one */
|
||||
}
|
||||
if (round == 2) {
|
||||
/* Got more items than expected; can happen
|
||||
* when adding items that match:
|
||||
* "contains=a.*b,axb".
|
||||
* Go back to first round */
|
||||
if (count >= total_count) {
|
||||
free(retval);
|
||||
round = 1;
|
||||
} else
|
||||
retval[count] = i + 1;
|
||||
}
|
||||
++count;
|
||||
id = -1; /* remember that we found one */
|
||||
}
|
||||
vim_regfree(regmatch.regprog);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user