Mesa (main): intel/compiler: fix singleton pointer coverity warning

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 19 10:42:19 UTC 2022


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

Author: Alexey Bozhenko <oleksii.bozhenko at globallogic.com>
Date:   Fri Apr 15 18:38:03 2022 +0300

intel/compiler: fix singleton pointer coverity warning

fix brw_kernel::stats member that was declared as a variable
but used as a pointer to array of 3 elements

CID: 1503279

Signed-off-by: Bozhenko Alexey <oleksii.bozhenko at globallogic.com>

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15975>

---

 src/intel/compiler/brw_kernel.c | 2 +-
 src/intel/compiler/brw_kernel.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/intel/compiler/brw_kernel.c b/src/intel/compiler/brw_kernel.c
index fe4349877bd..5f2e6f37d31 100644
--- a/src/intel/compiler/brw_kernel.c
+++ b/src/intel/compiler/brw_kernel.c
@@ -454,7 +454,7 @@ brw_kernel_from_spirv(struct brw_compiler *compiler,
       .nir = nir,
       .key = &key,
       .prog_data = &kernel->prog_data,
-      .stats = &kernel->stats,
+      .stats = kernel->stats,
       .log_data = log_data,
    };
 
diff --git a/src/intel/compiler/brw_kernel.h b/src/intel/compiler/brw_kernel.h
index 837dc57b4cd..b71b54b8666 100644
--- a/src/intel/compiler/brw_kernel.h
+++ b/src/intel/compiler/brw_kernel.h
@@ -49,7 +49,7 @@ struct brw_kernel_arg_desc {
 struct brw_kernel {
    struct brw_cs_prog_data prog_data;
 
-   struct brw_compile_stats stats;
+   struct brw_compile_stats stats[3];
 
    uint16_t args_size;
    uint16_t arg_count;



More information about the mesa-commit mailing list