diff options
author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2022-02-09 08:04:47 -0600 |
---|---|---|
committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2022-02-09 08:09:27 -0600 |
commit | 6be7c21b57e4a45b012209974ab9038b679134f5 (patch) | |
tree | 0948ddd21e939d29e0efb57b13db4faf4f88be8a /openmp/runtime/src/kmp_affinity.cpp | |
parent | 6f17768e11480063f4c2bcbeea559505fee3ea19 (diff) | |
download | llvm-6be7c21b57e4a45b012209974ab9038b679134f5.zip llvm-6be7c21b57e4a45b012209974ab9038b679134f5.tar.gz llvm-6be7c21b57e4a45b012209974ab9038b679134f5.tar.bz2 |
[OpenMP][libomp] Replace accidental VLA with KMP_ALLOCA
MSVC does not support variable length arrays. Replace with KMP_ALLOCA
which is already used in the same file for stack-allocated variables.
Diffstat (limited to 'openmp/runtime/src/kmp_affinity.cpp')
-rw-r--r-- | openmp/runtime/src/kmp_affinity.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp index 71e8b7f..d1f1b67 100644 --- a/openmp/runtime/src/kmp_affinity.cpp +++ b/openmp/runtime/src/kmp_affinity.cpp @@ -948,7 +948,7 @@ bool kmp_topology_t::filter_hw_subset() { bool using_core_effs = false; int hw_subset_depth = __kmp_hw_subset->get_depth(); kmp_hw_t specified[KMP_HW_LAST]; - int topology_levels[hw_subset_depth]; + int *topology_levels = (int *)KMP_ALLOCA(sizeof(int) * hw_subset_depth); KMP_ASSERT(hw_subset_depth > 0); KMP_FOREACH_HW_TYPE(i) { specified[i] = KMP_HW_UNKNOWN; } int core_level = get_level(KMP_HW_CORE); |