From 997c0b3939f6da8c32672bb4e640ebc86b167be0 Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Tue, 4 Nov 2014 15:41:49 +0100 Subject: 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. --- src/nvim/regexp.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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 #include #include #include @@ -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 -- cgit