From f11e80da017cf1f52c8b70de9dca9c8e3e4256d0 Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Mon, 21 Aug 2023 10:06:07 -0700 Subject: [PATCH] Fix out of bounds access in anderson2021_test_apps_autoscheduler (#7771) * Fix out of bounds access in anderson2021_test_apps_autoscheduler * clang-format --- src/autoschedulers/anderson2021/SearchSpace.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/autoschedulers/anderson2021/SearchSpace.cpp b/src/autoschedulers/anderson2021/SearchSpace.cpp index 27cd7fa033e8..bad8972435ce 100644 --- a/src/autoschedulers/anderson2021/SearchSpace.cpp +++ b/src/autoschedulers/anderson2021/SearchSpace.cpp @@ -127,11 +127,11 @@ vector SearchSpace::filter_parallel_tile_option if (c->node == node) { int64_t total = 1; int64_t max_available = 1; - for (const auto &l : c->stage->loop) { + for (size_t i = 0; i < c->stage->loop.size(); i++) { + const auto &l = c->stage->loop[i]; if (!l.rvar) { total *= o.outer_tiling[l.pure_dim]; - internal_assert(l.pure_dim < c->size.size()) << "l.pure_dim " << l.pure_dim << " c->size.size() " << c->size.size() << "\n"; - max_available *= c->size[l.pure_dim]; + max_available *= c->size[i]; } } max_total = std::max(max_total, total);