summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/kmp_runtime.cpp
diff options
context:
space:
mode:
authorJonathan Peyton <jonathan.l.peyton@intel.com>2018-08-24 18:05:00 +0000
committerJonathan Peyton <jonathan.l.peyton@intel.com>2018-08-24 18:05:00 +0000
commitca10a76f08b4a8741c6b5b469fe6f4099b2ffe0f (patch)
tree55bcb0a0246591dea65ec6e8116da5a088e263e2 /openmp/runtime/src/kmp_runtime.cpp
parentb1b221c82cc25adbe181d5c5886ad5423fede17d (diff)
downloadbcm5719-llvm-ca10a76f08b4a8741c6b5b469fe6f4099b2ffe0f.tar.gz
bcm5719-llvm-ca10a76f08b4a8741c6b5b469fe6f4099b2ffe0f.zip
[OpenMP] Add check for hot_teams array
If hot teams are not being used, this code could seg fault without the added check, and does so when composability is used in conjunction with nesting. The fix prevents the segfault. Differential Revision: https://reviews.llvm.org/D50649 llvm-svn: 340629
Diffstat (limited to 'openmp/runtime/src/kmp_runtime.cpp')
-rw-r--r--openmp/runtime/src/kmp_runtime.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/openmp/runtime/src/kmp_runtime.cpp b/openmp/runtime/src/kmp_runtime.cpp
index 0ccf6a5e8e7..44e50c19a26 100644
--- a/openmp/runtime/src/kmp_runtime.cpp
+++ b/openmp/runtime/src/kmp_runtime.cpp
@@ -2115,7 +2115,8 @@ int __kmp_fork_call(ident_t *loc, int gtid,
master_th->th.th_task_state;
master_th->th.th_task_state_top++;
#if KMP_NESTED_HOT_TEAMS
- if (team == master_th->th.th_hot_teams[active_level].hot_team) {
+ if (master_th->th.th_hot_teams &&
+ team == master_th->th.th_hot_teams[active_level].hot_team) {
// Restore master's nested state if nested hot team
master_th->th.th_task_state =
master_th->th
OpenPOWER on IntegriCloud