aco: fix out-of-bounds access when moving s_mem(real)time across SMEM
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 3 Feb 2023 17:27:52 +0000 (17:27 +0000)
committerEric Engestrom <eric@engestrom.ch>
Wed, 8 Feb 2023 20:34:46 +0000 (20:34 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8224
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21138>
(cherry picked from commit fad1f716dd831fba4c380bce1cf76bffc11be6d6)

.pick_status.json
src/amd/compiler/aco_scheduler.cpp

index 8510ecd..3d30194 100644 (file)
         "description": "aco: fix out-of-bounds access when moving s_mem(real)time across SMEM",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
index f097814..4ab13fe 100644 (file)
@@ -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;