diff options
author | Eliseo Martínez <eliseomarmol@gmail.com> | 2014-11-14 22:12:41 +0100 |
---|---|---|
committer | Eliseo Martínez <eliseomarmol@gmail.com> | 2014-11-18 21:57:47 +0100 |
commit | b4ae878407223965cdee6c88e7a55caf08b2a130 (patch) | |
tree | b8ba24d5f3b908a9d5f54572202e6f8d9fbc21cc | |
parent | 3f420ce0d829a8cdff9d55f6178989ca8e0406c9 (diff) | |
download | rneovim-b4ae878407223965cdee6c88e7a55caf08b2a130.tar.gz rneovim-b4ae878407223965cdee6c88e7a55caf08b2a130.tar.bz2 rneovim-b4ae878407223965cdee6c88e7a55caf08b2a130.zip |
Fix warnings: tag.c: get_tags(): Uninitialized arg: RI.
Problem : Uninitialized argument value @ 2798.
Diagnostic : Real issue.
Rationale : Tags doesn't have to have a kind. When they have one, both
`tp.tagkind` and `tp.tagkind_end` are nonnull. But when
they don't, `tp.tagkind` will we null (but defined), while
`tp.tagkind_end` will be undefined.
Therefore, reported invocation is indeed using a garbage
value for a tag with no kind.
Problem doesn't have consequences because `add_tag_field()`
doesn't use `end` param if `start` param is null.
Resolution : Don't use `tp.tagkind_end` if `tp.tagkind` is null.
-rw-r--r-- | src/nvim/tag.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 724261f08e..6ac6dc5cd2 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -2799,7 +2799,7 @@ int get_tags(list_T *list, char_u *pat) || add_tag_field(dict, "cmd", tp.command, tp.command_end) == FAIL || add_tag_field(dict, "kind", tp.tagkind, - tp.tagkind_end) == FAIL + tp.tagkind ? tp.tagkind_end : NULL) == FAIL || dict_add_nr_str(dict, "static", is_static, NULL) == FAIL) ret = FAIL; |