From e67a8dc59af44abb4b0349c66cfd5770985ff3ce Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 10 Jun 2024 13:45:50 -0700 Subject: [PATCH] clc: remove check for null pointer that cannot be true in llvm_mod_to_spirv Snce the *args parameter was added it's assumed to be non-null. If it is null then the function is going off to UB land. As such, a later check added for args being NULL is useless, and confuses coverity. fixes: 3a752256f54ce839f6e75d508df51eba6464ef77 Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/clc/clc_helpers.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/compiler/clc/clc_helpers.cpp b/src/compiler/clc/clc_helpers.cpp index 2e3287ee84e..f444b3a1de0 100644 --- a/src/compiler/clc/clc_helpers.cpp +++ b/src/compiler/clc/clc_helpers.cpp @@ -1039,9 +1039,7 @@ llvm_mod_to_spirv(std::unique_ptr<::llvm::Module> mod, return -1; } - const char *const *extensions = NULL; - if (args) - extensions = args->allowed_spirv_extensions; + const char *const *extensions = args->allowed_spirv_extensions; if (!extensions) { /* The SPIR-V parser doesn't handle all extensions */ static const char *default_extensions[] = {