Mesa (master): r600/sfn: Initialize ShaderInputVarying members in constructors.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Dec 9 06:09:30 UTC 2020
Module: Mesa
Branch: master
Commit: 34a35d8f2e0a90a64096fcb2372d2f137b91adb1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=34a35d8f2e0a90a64096fcb2372d2f137b91adb1
Author: Vinson Lee <vlee at freedesktop.org>
Date: Thu Dec 3 15:12:07 2020 -0800
r600/sfn: Initialize ShaderInputVarying members in constructors.
Fix defects reported by Coverity Scan.
uninit_member: Non-static class member m_interpolate is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member m_lds_pos is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member m_mask is not initialized in this constructor nor in any functions that it calls.
Signed-off-by: Vinson Lee <vlee at freedesktop.org>
Reviewed-by: Gert Wollny <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7909>
---
src/gallium/drivers/r600/sfn/sfn_shaderio.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/r600/sfn/sfn_shaderio.cpp b/src/gallium/drivers/r600/sfn/sfn_shaderio.cpp
index 429805d3ea1..b7a2f852ffe 100644
--- a/src/gallium/drivers/r600/sfn/sfn_shaderio.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_shaderio.cpp
@@ -120,6 +120,7 @@ ShaderInputVarying::ShaderInputVarying(tgsi_semantic _name, int sid, unsigned dr
m_interpolate(interpolate),
m_interpolate_loc(interp_loc),
m_ij_index(-10),
+ m_lds_pos(0),
m_mask((1 << components) - 1)
{
evaluate_spi_sid();
@@ -139,6 +140,7 @@ ShaderInputVarying::ShaderInputVarying(tgsi_semantic _name, int sid, nir_variabl
m_location_frac(input->data.location_frac),
m_sid(sid),
m_ij_index(-10),
+ m_lds_pos(0),
m_mask((1 << input->type->components()) - 1)
{
sfn_log << SfnLog::io << __func__
@@ -182,6 +184,10 @@ ShaderInputVarying::ShaderInputVarying(tgsi_semantic _name, int sid, nir_variabl
case INTERP_MODE_FLAT:
m_interpolate = TGSI_INTERPOLATE_CONSTANT;
break;
+
+ default:
+ m_interpolate = TGSI_INTERPOLATE_CONSTANT;
+ break;
}
if (input->data.sample) {
@@ -241,7 +247,8 @@ ShaderInputVarying::ShaderInputVarying(tgsi_semantic name,
m_interpolate(orig.m_interpolate),
m_interpolate_loc(orig.m_interpolate_loc),
m_ij_index(orig.m_ij_index),
- m_lds_pos(0)
+ m_lds_pos(0),
+ m_mask(0)
{
evaluate_spi_sid();
}
More information about the mesa-commit
mailing list