mirror of
https://github.com/neovim/neovim.git
synced 2026-04-04 22:59:36 +00:00
Fix warnings: regexp.c: skip_regexp: Np dereference: FP.
Problem: Derefence of null pointer @ 1208.
http://neovim.org/doc/reports/clang/report-24b5ca.html#Path10
Diagnostic: False positive.
Rationale : Error is reported to happen if after `if (*newp == NULL) {`
body, `*newp` continues being NULL, and false branch of
following `if (*newp != NULL)` is taken. Now, `vim_strsave`
cannot return NULL, so error cannot happen.
Resolution: Remove dead code (leftover since OOM refactors).
This commit is contained in:
@@ -1199,10 +1199,7 @@ char_u *skip_regexp(char_u *startp, int dirc, int magic, char_u **newp)
|
||||
*newp = vim_strsave(startp);
|
||||
p = *newp + (p - startp);
|
||||
}
|
||||
if (*newp != NULL)
|
||||
STRMOVE(p, p + 1);
|
||||
else
|
||||
++p;
|
||||
STRMOVE(p, p + 1);
|
||||
} else
|
||||
++p; /* skip next character */
|
||||
if (*p == 'v')
|
||||
|
||||
Reference in New Issue
Block a user