[OpenMP] libomp cleanup: add checks of bad memory access
authorAndreyChurbanov <andrey.churbanov@intel.com>
Mon, 20 Jul 2020 21:12:46 +0000 (00:12 +0300)
committerAndreyChurbanov <andrey.churbanov@intel.com>
Mon, 20 Jul 2020 21:12:46 +0000 (00:12 +0300)
commit917f8421591d2cc53c48ebd17d88b0dd3255aa2c
treeb82124bd834fd2c72f7afd81ebf84ffad27d606a
parent001c8e1fd9f09d3de9ff6e64bdac4b8ca681dfb4
[OpenMP] libomp cleanup: add checks of bad memory access

Add check of frm to prevent array out-of-bound access;
add check of new_nproc to prevent access of unallocated hot_teams array;
add check of location info pointer to prevent NULL dereference;
add check of d_tn pointer to prevent NULL dereference in release build.
These checks make static analyzers happier.

This is second part of the patch from https://reviews.llvm.org/D84062.
openmp/runtime/src/kmp_itt.inl
openmp/runtime/src/kmp_runtime.cpp
openmp/runtime/src/kmp_sched.cpp
openmp/runtime/src/kmp_threadprivate.cpp