From cd222e4a9cf0727e9b38e7f26d00ff2e2e8acb02 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 3 Dec 2020 15:52:34 -0800 Subject: glsl: Initialize parcel_out_uniform_storage members. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Marek Olšák Part-of: --- 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() -- cgit v1.2.3