From 54e8138bbc8f694eaa47bfb289251ae7c7e12210 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 2 Nov 2020 17:59:46 -0800 Subject: [PATCH] r600/sb: Initialize sb_context members in constructor. Fix defects reported by Coverity Scan. Uninitialized scalar field (UNINIT_CTOR) uninit_member: Non-static class member alu_temp_gprs is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member max_fetch is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member has_trans is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member vtx_src_num is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member num_slots is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member uses_mova_gpr is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member r6xx_gpr_index_workaround is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member stack_workaround_8xx is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member stack_workaround_9xx is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member wavefront_size is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member stack_entry_size is not initialized in this constructor nor in any functions that it calls. Signed-off-by: Vinson Lee Reviewed-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/sb/sb_bc.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/r600/sb/sb_bc.h b/src/gallium/drivers/r600/sb/sb_bc.h index 942e228d95c..ef2f398556e 100644 --- a/src/gallium/drivers/r600/sb/sb_bc.h +++ b/src/gallium/drivers/r600/sb/sb_bc.h @@ -692,7 +692,12 @@ public: static unsigned dskip_mode; sb_context() : src_stats(), opt_stats(), isa(0), - hw_chip(HW_CHIP_UNKNOWN), hw_class(HW_CLASS_UNKNOWN) {} + hw_chip(HW_CHIP_UNKNOWN), hw_class(HW_CLASS_UNKNOWN), + alu_temp_gprs(0), max_fetch(0), has_trans(false), vtx_src_num(0), + num_slots(0), uses_mova_gpr(false), + r6xx_gpr_index_workaround(false), stack_workaround_8xx(false), + stack_workaround_9xx(false), wavefront_size(0), + stack_entry_size(0) {} int init(r600_isa *isa, sb_hw_chip chip, sb_hw_class cclass);