Added checks on negative gtid before indexing __kmp_threads.
This makes static analyzers happier.
Details
Details
Diff Detail
Diff Detail
Unit Tests
Unit Tests
Event Timeline
Comment Actions
I don't think so. We don't use negative gtid for unshackled threads, but thanks for the head up.
openmp/runtime/src/kmp.h | ||
---|---|---|
3082 | Do we need to check whether gtid is less than the size of __kmp_threads? |
Comment Actions
LGTM for the gtid changes. there are at least three other things in this commit that need to be split. I don't think they are bad but not described or related to this.
openmp/runtime/src/kmp_itt.inl | ||
---|---|---|
235 | This seems unrelated. | |
openmp/runtime/src/kmp_runtime.cpp | ||
4946 | I guess this is unrelated too. | |
openmp/runtime/src/kmp_sched.cpp | ||
68 ↗ | (On Diff #278910) | This belongs in a different commit. |
Comment Actions
OK, I will commit the patch in two parts - one pure gtid checks, another one with other arrays/pointers checks.
clang-tidy: warning: unused function 'kmp_assert_valid_gtid' [clang-diagnostic-unused-function]
not useful
clang-tidy: warning: invalid case style for function 'kmp_assert_valid_gtid' [readability-identifier-naming]
not useful
clang-tidy: warning: invalid case style for parameter 'gtid' [readability-identifier-naming]
not useful