[Openmp-commits] [PATCH] D63599: Fixed memory use-after-free problem.

Jonas Hahnfeld via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jun 20 08:47:45 PDT 2019


Hahnfeld added inline comments.


================
Comment at: runtime/src/kmp_csupport.cpp:444
+  KMP_DEBUG_ASSERT(tmp->cg_nthreads);
+  int i = tmp->cg_nthreads--;
+  if (i == 1) { // check is we are the last thread in CG (not always the case)
----------------
Is this safe without atomics? I've only briefly looked over the code, most other usages of `cg_nthreads` are protected by `__kmp_forkjoin_lock` (at least according to comments). I don't see this here, but maybe I'm missing the relevant call.


Repository:
  rOMP OpenMP

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63599/new/

https://reviews.llvm.org/D63599





More information about the Openmp-commits mailing list