From 801955851b9a1bbcc708e762a33790c223e701f0 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Fri, 25 Dec 2020 13:03:43 +0100 Subject: [PATCH] Workaround clang-tidy incorrectly assuming null This silences a false positive linter warning about a null dereference. --- src/builtin_complete.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/builtin_complete.cpp b/src/builtin_complete.cpp index a2d44b348..42e7a0831 100644 --- a/src/builtin_complete.cpp +++ b/src/builtin_complete.cpp @@ -205,6 +205,7 @@ maybe_t builtin_complete(parser_t &parser, io_streams_t &streams, wchar_t * } case 'd': { desc = w.woptarg; + assert(desc); break; } case 'u': { @@ -249,6 +250,7 @@ maybe_t builtin_complete(parser_t &parser, io_streams_t &streams, wchar_t * } case 'a': { comp = w.woptarg; + assert(comp); break; } case 'e': { @@ -257,6 +259,7 @@ maybe_t builtin_complete(parser_t &parser, io_streams_t &streams, wchar_t * } case 'n': { condition = w.woptarg; + assert(condition); break; } case 'w': {