From: Vasily Khoruzhick Date: Sun, 1 Sep 2019 21:38:08 +0000 (-0700) Subject: lima/gpir: fix warning in gpir disassembler X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=996f1b61745f9e9f6b32a3602911f77ede377ca3;p=mesa.git lima/gpir: fix warning in gpir disassembler Fixes following warning: ../src/gallium/drivers/lima/ir/gp/disasm.c: In function ‘print_src’: ../src/gallium/drivers/lima/ir/gp/disasm.c:241:20: warning: array subscript 28 is above array bounds of ‘char[5]’ [-Warray-bounds] 241 | "xyzw"[src - gpir_codegen_src_attrib_x]); Reviewed-by: Connor Abbott Reviewed-by: Erico Nunes Reviewed-by: Andreas Baierl Signed-off-by: Vasily Khoruzhick --- diff --git a/src/gallium/drivers/lima/ir/gp/disasm.c b/src/gallium/drivers/lima/ir/gp/disasm.c index 41a04942ec9..6b5186fa633 100644 --- a/src/gallium/drivers/lima/ir/gp/disasm.c +++ b/src/gallium/drivers/lima/ir/gp/disasm.c @@ -238,7 +238,7 @@ print_src(gpir_codegen_src src, gp_unit unit, unsigned unit_src_num, case gpir_codegen_src_p1_attrib_w: printf("%c%d.%c", prev_instr->register0_attribute ? 'a' : '$', prev_instr->register0_addr, - "xyzw"[src - gpir_codegen_src_attrib_x]); + "xyzw"[src - gpir_codegen_src_p1_attrib_x]); break; } }