From 65ba14519ea23193c85cc20729dd31194a49382c Mon Sep 17 00:00:00 2001 From: "Eric R. Smith" Date: Mon, 17 Nov 2025 19:24:46 -0400 Subject: [PATCH] pan: fix a bifrost disassembly assert failure We were overflowing an array during bifrost disassembly. This was only a problem if the user explicitly set an environment variable, so unlikely to occur in casual use, and also only could be triggered in very specific, dense code. But we still should get this right! The specific CTS test that caused the assert is: 'dEQP-VK.graphicsfuzz.stable-quicksort-for-loop-with-injection' with environment variable `BIFROST_MESA_DEBUG=shaders`. One of the shaders has a clause with 6 constants (the maximum) and this overflowed the array because we assume we always have an extra slot (used for modifier processing). Cc: mesa-stable Reviewed-by: Christoph Pillmayer Part-of: --- src/panfrost/compiler/bifrost.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/panfrost/compiler/bifrost.h b/src/panfrost/compiler/bifrost.h index fe9c268bcb2..abe271cdc83 100644 --- a/src/panfrost/compiler/bifrost.h +++ b/src/panfrost/compiler/bifrost.h @@ -619,10 +619,13 @@ enum bi_constmod { struct bi_constants { /* Raw constant values */ - uint64_t raw[6]; + /* There are at most 6 constants per clause, but internally + * we can use an extra slot for modifiers, so give room for 7 + */ + uint64_t raw[7]; /* Associated modifier derived from M values */ - enum bi_constmod mods[6]; + enum bi_constmod mods[7]; }; /* FAU selectors for constants are out-of-order, construct the top bits