mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00: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:
@@ -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
|
||||
|
Reference in New Issue
Block a user