blorp: Fix potential read of uninitaized elk fields in debug paths

The intel_vue_map is only partially initialized before being used. All
used fields are initialized, but in debug paths the unitialzed fields
will also be read. To fix this initialize the struct to 0. In the brw
path this struct is part of the prog_data, and is rzalloc'd.

CID: 1665308
Reviewed-by: Iván Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37261>
This commit is contained in:
Dylan Baker 2025-09-09 18:29:38 +00:00 committed by Marge Bot
parent 6fe4b7344d
commit ecfce9f9ad

View file

@ -232,7 +232,8 @@ blorp_ensure_sf_program_elk(struct blorp_batch *batch,
const unsigned *program;
unsigned program_size;
struct intel_vue_map vue_map;
/* Some fields that are not set can be read in debug paths, so initialization is required */
struct intel_vue_map vue_map = {0};
elk_compute_vue_map(compiler->devinfo, &vue_map, slots_valid,
INTEL_VUE_LAYOUT_FIXED, 1);