summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinson Lee <vlee@freedesktop.org>2020-11-24 18:51:10 -0800
committerVinson Lee <vlee@freedesktop.org>2020-12-16 19:31:25 -0800
commit193888fd7578fed0afd8e8f22a346dc127952da7 (patch)
treeff7644f0e2aeeb93e13e42274b8e788570c180cc
parentdaf339a4795c96ebc7295a3184fa59a13fdecbf0 (diff)
glsl: Initialize glsl_type member name.
Fix defect reported by Coverity Scan. Uninitialized pointer field (UNINIT_CTOR) uninit_member: Non-static class member name is not initialized in this constructor nor in any functions that it calls. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7766>
-rw-r--r--src/compiler/glsl_types.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
index f5cc1742c17..98d962481e1 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -175,6 +175,8 @@ glsl_type::glsl_type(const glsl_type *return_type,
this->mem_ctx = ralloc_context(NULL);
assert(this->mem_ctx != NULL);
+ this->name = ralloc_strdup(this->mem_ctx, "");
+
this->fields.parameters = rzalloc_array(this->mem_ctx,
glsl_function_param, num_params + 1);