mirror of
https://github.com/neovim/neovim.git
synced 2025-09-26 21:18:34 +00:00
syntax: Silence PVS/V522: retval is always non-NULL on this round
This commit is contained in:
@@ -5321,18 +5321,19 @@ get_id_list (
|
|||||||
for (int i = highlight_ga.ga_len; --i >= 0; ) {
|
for (int i = highlight_ga.ga_len; --i >= 0; ) {
|
||||||
if (vim_regexec(®match, HL_TABLE()[i].sg_name, (colnr_T)0)) {
|
if (vim_regexec(®match, HL_TABLE()[i].sg_name, (colnr_T)0)) {
|
||||||
if (round == 2) {
|
if (round == 2) {
|
||||||
/* Got more items than expected; can happen
|
// Got more items than expected; can happen
|
||||||
* when adding items that match:
|
// when adding items that match:
|
||||||
* "contains=a.*b,axb".
|
// "contains=a.*b,axb".
|
||||||
* Go back to first round */
|
// Go back to first round.
|
||||||
if (count >= total_count) {
|
if (count >= total_count) {
|
||||||
xfree(retval);
|
xfree(retval);
|
||||||
round = 1;
|
round = 1;
|
||||||
} else
|
} else {
|
||||||
retval[count] = i + 1;
|
retval[count] = i + 1; // -V522
|
||||||
}
|
}
|
||||||
++count;
|
}
|
||||||
id = -1; /* remember that we found one */
|
count++;
|
||||||
|
id = -1; // Remember that we found one.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
vim_regfree(regmatch.regprog);
|
vim_regfree(regmatch.regprog);
|
||||||
@@ -5346,13 +5347,14 @@ get_id_list (
|
|||||||
}
|
}
|
||||||
if (id > 0) {
|
if (id > 0) {
|
||||||
if (round == 2) {
|
if (round == 2) {
|
||||||
/* Got more items than expected, go back to first round */
|
// Got more items than expected, go back to first round.
|
||||||
if (count >= total_count) {
|
if (count >= total_count) {
|
||||||
xfree(retval);
|
xfree(retval);
|
||||||
round = 1;
|
round = 1;
|
||||||
} else
|
} else {
|
||||||
retval[count] = id;
|
retval[count] = id;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
p = skipwhite(end);
|
p = skipwhite(end);
|
||||||
|
Reference in New Issue
Block a user