aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp.c
diff options
context:
space:
mode:
authorEliseo Martínez <eliseomarmol@gmail.com>2014-11-04 15:41:49 +0100
committerEliseo Martínez <eliseomarmol@gmail.com>2014-11-06 09:51:45 +0100
commit997c0b3939f6da8c32672bb4e640ebc86b167be0 (patch)
tree36f2f8bbd52c76bda788b1d669d909e26258b0fe /src/nvim/regexp.c
parent22475b5ae80b5c08115677b9abc5c62258716c08 (diff)
downloadrneovim-997c0b3939f6da8c32672bb4e640ebc86b167be0.tar.gz
rneovim-997c0b3939f6da8c32672bb4e640ebc86b167be0.tar.bz2
rneovim-997c0b3939f6da8c32672bb4e640ebc86b167be0.zip
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.
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r--src/nvim/regexp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index 93fc5c62ef..cef2e6d9bf 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -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