From c7c4aad38740b71b7e8a72321ce524fb2d07c4ab Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 20 May 2017 04:35:42 +0300 Subject: [PATCH] tag: Silence V522: potential null dereference Call PVS is referring to is using DT_FREE which will make function exit earlier, in #ifdef EXITFREE block. --- src/nvim/tag.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/nvim/tag.c b/src/nvim/tag.c index b8b86bf979..88b45add54 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -208,10 +208,9 @@ do_tag ( clearpos(&saved_fmark.mark); /* shutup gcc 4.0 */ saved_fmark.fnum = 0; - /* - * Don't add a tag to the tagstack if 'tagstack' has been reset. - */ - if (!p_tgst && *tag != NUL) { + // Don't add a tag to the tagstack if 'tagstack' has been reset. + assert(tag != NULL); + if (!p_tgst && *tag != NUL) { // -V522 use_tagstack = false; new_tag = true; if (g_do_tagpreview != 0) {