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:
Eliseo Martínez 2014-11-04 15:41:49 +01:00
parent 22475b5ae8
commit 997c0b3939

View File

@ -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