Mesa (master): glsl: Initialize parcel_out_uniform_storage members.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Mar 31 04:58:40 UTC 2021


Module: Mesa
Branch: master
Commit: cd222e4a9cf0727e9b38e7f26d00ff2e2e8acb02
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cd222e4a9cf0727e9b38e7f26d00ff2e2e8acb02

Author: Vinson Lee <vlee at freedesktop.org>
Date:   Thu Dec  3 15:52:34 2020 -0800

glsl: Initialize parcel_out_uniform_storage members.

Fix defects reported by Coverity Scan.

uninit_member: Non-static class member buffer_block_index is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member ubo_byte_offset is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member shader_type is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member next_sampler is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member next_bindless_sampler is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member next_image is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member next_bindless_image is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member next_subroutine is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member field_counter is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member current_var is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member explicit_location is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member record_array_count is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member record_next_sampler is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member record_next_image is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member record_next_bindless_sampler is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member record_next_bindless_image is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member targets is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member shader_samplers_used is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member shader_shadow_samplers is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member num_bindless_samplers is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member num_bindless_images is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7910>

---

 src/compiler/glsl/link_uniforms.cpp | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index f0e229526f6..cb1655a97e0 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -685,11 +685,24 @@ public:
                               struct gl_uniform_storage *uniforms,
                               union gl_constant_value *values,
                               bool use_std430_as_default)
-      : prog(prog), map(map), uniforms(uniforms),
-        use_std430_as_default(use_std430_as_default), values(values),
-        bindless_targets(NULL), bindless_access(NULL),
+      : buffer_block_index(0), ubo_byte_offset(0),
+        shader_type(MESA_SHADER_NONE),
+        prog(prog), map(map), uniforms(uniforms),
+        next_sampler(0), next_bindless_sampler(0), next_image(0),
+        next_bindless_image(0), next_subroutine(0),
+        use_std430_as_default(use_std430_as_default),
+        field_counter(0), current_var(NULL), explicit_location(0),
+        record_array_count(0), record_next_sampler(NULL),
+        record_next_image(NULL), record_next_bindless_sampler(NULL),
+        record_next_bindless_image(NULL),
+        values(values),
+        shader_samplers_used(0), shader_shadow_samplers(0),
+        num_bindless_samplers(0),
+        bindless_targets(NULL), num_bindless_images(0),
+        bindless_access(NULL),
         shader_storage_blocks_write_access(0)
    {
+      memset(this->targets, 0, sizeof(this->targets));
    }
 
    virtual ~parcel_out_uniform_storage()



More information about the mesa-commit mailing list