Mesa (main): clover: Add constructor for image_rd_argument.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 29 23:11:28 UTC 2021


Module: Mesa
Branch: main
Commit: 20620af1e4c9f203aabb9950a9de0536e25db1dd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=20620af1e4c9f203aabb9950a9de0536e25db1dd

Author: Vinson Lee <vlee at freedesktop.org>
Date:   Fri Oct 22 19:04:21 2021 -0700

clover: Add constructor for image_rd_argument.

Fix defect reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize st.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
Reviewed-by: Karol Herbst <kherbst at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13500>

---

 src/gallium/frontends/clover/core/kernel.cpp | 3 +++
 src/gallium/frontends/clover/core/kernel.hpp | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/src/gallium/frontends/clover/core/kernel.cpp b/src/gallium/frontends/clover/core/kernel.cpp
index 3fe698bec41..b07907e471b 100644
--- a/src/gallium/frontends/clover/core/kernel.cpp
+++ b/src/gallium/frontends/clover/core/kernel.cpp
@@ -584,6 +584,9 @@ kernel::constant_argument::unbind(exec_context &ctx) {
       buf->resource_in(*ctx.q).unbind_surface(*ctx.q, st);
 }
 
+kernel::image_rd_argument::image_rd_argument() : st(nullptr) {
+}
+
 void
 kernel::image_rd_argument::set(size_t size, const void *value) {
    if (!value)
diff --git a/src/gallium/frontends/clover/core/kernel.hpp b/src/gallium/frontends/clover/core/kernel.hpp
index e9d3bc92767..2b543ce6d3c 100644
--- a/src/gallium/frontends/clover/core/kernel.hpp
+++ b/src/gallium/frontends/clover/core/kernel.hpp
@@ -218,6 +218,8 @@ namespace clover {
 
       class image_rd_argument : public image_argument {
       public:
+         image_rd_argument();
+
          virtual void set(size_t size, const void *value);
          virtual void bind(exec_context &ctx,
                            const binary::argument &barg);



More information about the mesa-commit mailing list