Index: openmp/tools/archer/ompt-tsan.cpp =================================================================== --- openmp/tools/archer/ompt-tsan.cpp +++ openmp/tools/archer/ompt-tsan.cpp @@ -1001,20 +1001,22 @@ if (ndeps > 0) { // Copy the data to use it in task_switch and task_end. TaskData *Data = ToTaskData(task_data); - if (!Data->Parent->DependencyMap) + if (Data->Parent != nullptr && !Data->Parent->DependencyMap) Data->Parent->DependencyMap = new std::unordered_map(); Data->Dependencies = (TaskDependency *)malloc(sizeof(TaskDependency) * ndeps); Data->DependencyCount = ndeps; for (int i = 0; i < ndeps; i++) { - auto ret = Data->Parent->DependencyMap->insert( - std::make_pair(deps[i].variable.ptr, nullptr)); - if (ret.second) { - ret.first->second = DependencyData::New(); + if (Data->Parent != nullptr) { + auto ret = Data->Parent->DependencyMap->insert( + std::make_pair(deps[i].variable.ptr, nullptr)); + if (ret.second) { + ret.first->second = DependencyData::New(); + } + new ((void *)(Data->Dependencies + i)) + TaskDependency(ret.first->second, deps[i].dependence_type); } - new ((void *)(Data->Dependencies + i)) - TaskDependency(ret.first->second, deps[i].dependence_type); } // This callback is executed before this task is first started.