gcc/analyzer: fix false positives for NULL (#13248)

Close https://github.com/neovim/neovim/issues/13158
This commit is contained in:
Jan Edmund Lazo
2020-11-08 22:48:17 -05:00
committed by GitHub
parent 94062831b3
commit 4e6f00dd29
4 changed files with 15 additions and 8 deletions

View File

@@ -3451,13 +3451,13 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout,
sub_firstline = NULL;
/*
* ~ in the substitute pattern is replaced with the old pattern.
* We do it here once to avoid it to be replaced over and over again.
* But don't do it when it starts with "\=", then it's an expression.
*/
if (!(sub[0] == '\\' && sub[1] == '='))
// ~ in the substitute pattern is replaced with the old pattern.
// We do it here once to avoid it to be replaced over and over again.
// But don't do it when it starts with "\=", then it's an expression.
assert(sub != NULL);
if (!(sub[0] == '\\' && sub[1] == '=')) {
sub = regtilde(sub, p_magic);
}
// Check for a match on each line.
// If preview: limit to max('cmdwinheight', viewport).