From ba474aff623ba80709f07ceb4346a0d033a173c9 Mon Sep 17 00:00:00 2001 From: M Henning Date: Tue, 25 Apr 2023 01:41:03 -0400 Subject: [PATCH] nouveau/codegen: Check nir_dest_num_components instead of reaching into a union and pulling out garbage when the dest is a reg Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8863 Reviewed-by: Karol Herbst Part-of: (cherry picked from commit d49c7b958214e551e10d09be300c5cdaf951315d) --- .pick_status.json | 2 +- src/nouveau/codegen/nv50_ir_from_nir.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 771db7e2a03..c3353131e90 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -10334,7 +10334,7 @@ "description": "nouveau/codegen: Check nir_dest_num_components", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/nouveau/codegen/nv50_ir_from_nir.cpp b/src/nouveau/codegen/nv50_ir_from_nir.cpp index 7d18610ea48..ab87169dda1 100644 --- a/src/nouveau/codegen/nv50_ir_from_nir.cpp +++ b/src/nouveau/codegen/nv50_ir_from_nir.cpp @@ -2532,7 +2532,7 @@ Converter::visit(nir_load_const_instr *insn) } #define DEFAULT_CHECKS \ - if (insn->dest.dest.ssa.num_components > 1) { \ + if (nir_dest_num_components(insn->dest.dest) > 1) { \ ERROR("nir_alu_instr only supported with 1 component!\n"); \ return false; \ } \