From da18ac5dfabd14043e3daa2d5185dbda8def69b7 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 22 Feb 2024 18:06:04 -0400 Subject: [PATCH] agx: add more asserts sigh, C Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_register_allocate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/asahi/compiler/agx_register_allocate.c b/src/asahi/compiler/agx_register_allocate.c index 0008ba6a496..161c4f0b527 100644 --- a/src/asahi/compiler/agx_register_allocate.c +++ b/src/asahi/compiler/agx_register_allocate.c @@ -1287,6 +1287,7 @@ agx_ra(agx_context *ctx) continue; assert(ins->src[i].size == ins->src[0].size); + assert(n < ins->nr_srcs); copies[n++] = (struct agx_copy){ .dest = base + (i * width), .src = ins->src[i], @@ -1318,6 +1319,7 @@ agx_ra(agx_context *ctx) src.channels_m1 = 0; src.value += (i * width); + assert(n < ARRAY_SIZE(copies)); copies[n++] = (struct agx_copy){ .dest = ins->dest[i].value, .src = src,