ac/nir: Fix out of bounds array access.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 29 Nov 2016 23:41:16 +0000 (00:41 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 30 Nov 2016 06:09:38 +0000 (07:09 +0100)
With nir_intrinsic_ssbo_atomic_comp_swap we run out of params.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index ee98f5f88e8989a56086a1e614526ff89369517a..df121d853c2b0b55e120f7ae50efcb9572bbe195 100644 (file)
@@ -1946,7 +1946,7 @@ static LLVMValueRef visit_atomic_ssbo(struct nir_to_llvm_context *ctx,
                                       nir_intrinsic_instr *instr)
 {
        const char *name;
-       LLVMValueRef params[5];
+       LLVMValueRef params[6];
        int arg_count = 0;
        if (ctx->stage == MESA_SHADER_FRAGMENT)
                ctx->shader_info->fs.writes_memory = true;