From 996f1b61745f9e9f6b32a3602911f77ede377ca3 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Sun, 1 Sep 2019 14:38:08 -0700 Subject: [PATCH] lima/gpir: fix warning in gpir disassembler MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/gallium/drivers/lima/ir/gp/disasm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } } -- 2.30.2