make arrayname size a bit larger

[addr%d] could in theory be [addr65536] so needs a few more bytes.

Fixes warning:
vrend_shader.c: In function ‘iter_instruction’:
vrend_shader.c:1861:38: warning: ‘%d’ directive writing between 1 and 6 bytes into a region of size 4 [-Wformat-overflow=]
             sprintf(arrayname, "[addr%d]", src->DimIndirect.Index);
                                      ^~
vrend_shader.c:1861:32: note: directive argument in the range [-32768, 32767]
             sprintf(arrayname, "[addr%d]", src->DimIndirect.Index);
                                ^~~~~~~~~~
vrend_shader.c:1861:13: note: ‘sprintf’ output between 8 and 13 bytes into a destination of size 9
             sprintf(arrayname, "[addr%d]", src->DimIndirect.Index);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
macos/master
Dave Airlie 7 years ago
parent e95aa50ca4
commit c96011d2ac
  1. 2
      src/vrend_shader.c

@ -1842,7 +1842,7 @@ iter_instruction(struct tgsi_iterate_context *iter,
const struct tgsi_full_src_register *src = &inst->Src[i]; const struct tgsi_full_src_register *src = &inst->Src[i];
char swizzle[8] = {0}; char swizzle[8] = {0};
char prefix[6] = {0}; char prefix[6] = {0};
char arrayname[9] = {0}; char arrayname[16] = {0};
int swz_idx = 0, pre_idx = 0; int swz_idx = 0, pre_idx = 0;
boolean isabsolute = src->Register.Absolute; boolean isabsolute = src->Register.Absolute;

Loading…
Cancel
Save