From 830ee0d70dbf06c71ae2a96f704e3cc1f2a730e1 Mon Sep 17 00:00:00 2001 From: aekul Date: Wed, 16 Aug 2023 22:15:23 -0700 Subject: [PATCH 1/2] Fix out of bounds access in anderson2021_test_apps_autoscheduler --- 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..d3772953914c 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); From 0eed50039e7d8fe57961c348293972423c9c19de Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Wed, 16 Aug 2023 22:47:10 -0700 Subject: [PATCH 2/2] clang-format --- src/autoschedulers/anderson2021/SearchSpace.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/autoschedulers/anderson2021/SearchSpace.cpp b/src/autoschedulers/anderson2021/SearchSpace.cpp index d3772953914c..bad8972435ce 100644 --- a/src/autoschedulers/anderson2021/SearchSpace.cpp +++ b/src/autoschedulers/anderson2021/SearchSpace.cpp @@ -128,7 +128,7 @@ vector SearchSpace::filter_parallel_tile_option int64_t total = 1; int64_t max_available = 1; for (size_t i = 0; i < c->stage->loop.size(); i++) { - const auto& l = c->stage->loop[i]; + const auto &l = c->stage->loop[i]; if (!l.rvar) { total *= o.outer_tiling[l.pure_dim]; max_available *= c->size[i];