mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Fix warnings: regexp.c: match_with_backref(): Nonnull violation: FP.
Problem: Argument with 'nonnull' attribute passed null @ 5632. http://neovim.org/doc/reports/clang/report-041a0e.html#EndPath. Diagnostic: False positive. Rationale : `p = reg_getline(clnum)` above should not be null, because `clnum` starts at `start_lnum` and only increments after that. Resolution: Assert p not null.
This commit is contained in:
parent
22475b5ae8
commit
997c0b3939
@ -43,6 +43,7 @@
|
||||
/* #undef REGEXP_DEBUG */
|
||||
/* #define REGEXP_DEBUG */
|
||||
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
@ -5625,6 +5626,8 @@ static int match_with_backref(linenr_T start_lnum, colnr_T start_col, linenr_T e
|
||||
|
||||
/* Get the line to compare with. */
|
||||
p = reg_getline(clnum);
|
||||
assert(p);
|
||||
|
||||
if (clnum == end_lnum)
|
||||
len = end_col - ccol;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user