Module: Mesa
Branch: main
Commit: fad1f716dd831fba4c380bce1cf76bffc11be6d6
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fad1f716dd831fba4c380bce1cf76bffc11be6d6

Author: Rhys Perry <[email protected]>
Date:   Fri Feb  3 17:27:52 2023 +0000

aco: fix out-of-bounds access when moving s_mem(real)time across SMEM

Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Georg Lehmann <[email protected]>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8224
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21138>

---

 src/amd/compiler/aco_scheduler.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_scheduler.cpp 
b/src/amd/compiler/aco_scheduler.cpp
index f09781435bc..4ab13fe7c30 100644
--- a/src/amd/compiler/aco_scheduler.cpp
+++ b/src/amd/compiler/aco_scheduler.cpp
@@ -679,7 +679,7 @@ schedule_SMEM(sched_ctx& ctx, Block* block, 
std::vector<RegisterDemand>& registe
            current->operands[0].size() == 4))
          break;
       /* don't move descriptor loads below buffer loads */
-      if (candidate->format == Format::SMEM && current->operands[0].size() == 
4 &&
+      if (candidate->isSMEM() && !candidate->operands.empty() && 
current->operands[0].size() == 4 &&
           candidate->operands[0].size() == 2)
          break;
 

Reply via email to