[Openmp-commits] [PATCH] D50649: [OpenMP] Add check for hot_teams array

Jonathan Peyton via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Aug 13 10:41:50 PDT 2018


jlpeyton created this revision.
jlpeyton added reviewers: AndreyChurbanov, tlwilmar, hbae, omalyshe.
jlpeyton added a project: OpenMP.
Herald added a subscriber: guansong.

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.


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D50649

Files:
  runtime/src/kmp_runtime.cpp


Index: runtime/src/kmp_runtime.cpp
===================================================================
--- runtime/src/kmp_runtime.cpp
+++ runtime/src/kmp_runtime.cpp
@@ -2115,7 +2115,8 @@
             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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50649.160395.patch
Type: text/x-patch
Size: 625 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20180813/9a8eb375/attachment.bin>


More information about the Openmp-commits mailing list