Mesa (master): clover: Add constructor for constant_argument.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 29 05:50:29 UTC 2021


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

Author: Vinson Lee <vlee at freedesktop.org>
Date:   Wed Apr 21 19:17:15 2021 -0700

clover: Add constructor for constant_argument.

Fix defects reported by Coverity Scan.

member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize buf.
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/10399>

---

 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 3f58973ff05..36a81ee04e1 100644
--- a/src/gallium/frontends/clover/core/kernel.cpp
+++ b/src/gallium/frontends/clover/core/kernel.cpp
@@ -537,6 +537,9 @@ void
 kernel::local_argument::unbind(exec_context &ctx) {
 }
 
+kernel::constant_argument::constant_argument() : buf(nullptr), st(nullptr) {
+}
+
 void
 kernel::constant_argument::set(size_t size, const void *value) {
    if (size != sizeof(cl_mem))
diff --git a/src/gallium/frontends/clover/core/kernel.hpp b/src/gallium/frontends/clover/core/kernel.hpp
index 684aefa29ee..a2264376cce 100644
--- a/src/gallium/frontends/clover/core/kernel.hpp
+++ b/src/gallium/frontends/clover/core/kernel.hpp
@@ -195,6 +195,8 @@ namespace clover {
 
       class constant_argument : public argument {
       public:
+         constant_argument();
+
          virtual void set(size_t size, const void *value);
          virtual void bind(exec_context &ctx,
                            const module::argument &marg);



More information about the mesa-commit mailing list