ac: fix possible truncation of intrinsic name
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 7 Jun 2018 00:30:01 +0000 (10:30 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 7 Jun 2018 23:24:15 +0000 (09:24 +1000)
Fixes the gcc warning:
snprintf’ output between 26 and 33 bytes into a destination of size 32

Fixes: d5f7ebda3ec0 ("ac: add LLVM build functions for subgroup instrinsics")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_llvm_build.c

index 4052488f03ae174e750ac75e35486f2e7de86a61..133003b779ab8876ad16ee8897aad1b8b7ce39a6 100644 (file)
@@ -2995,7 +2995,7 @@ static LLVMValueRef
 ac_build_set_inactive(struct ac_llvm_context *ctx, LLVMValueRef src,
                      LLVMValueRef inactive)
 {
-       char name[32], type[8];
+       char name[33], type[8];
        LLVMTypeRef src_type = LLVMTypeOf(src);
        src = ac_to_integer(ctx, src);
        inactive = ac_to_integer(ctx, inactive);