[Openmp-commits] [openmp] r340629 - [OpenMP] Add check for hot_teams array

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Fri Aug 24 11:05:01 PDT 2018


Author: jlpeyton
Date: Fri Aug 24 11:05:00 2018
New Revision: 340629

URL: http://llvm.org/viewvc/llvm-project?rev=340629&view=rev
Log:
[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

Modified:
    openmp/trunk/runtime/src/kmp_runtime.cpp

Modified: openmp/trunk/runtime/src/kmp_runtime.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_runtime.cpp?rev=340629&r1=340628&r2=340629&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_runtime.cpp (original)
+++ openmp/trunk/runtime/src/kmp_runtime.cpp Fri Aug 24 11:05:00 2018
@@ -2115,7 +2115,8 @@ int __kmp_fork_call(ident_t *loc, int gt
             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




More information about the Openmp-commits mailing list