[Openmp-commits] [openmp] [OpenMP] avoid segv for a lock that has already been destroyed (PR #145625)

via Openmp-commits openmp-commits at lists.llvm.org
Wed Jun 25 10:16:47 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- openmp/runtime/src/kmp_lock.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/openmp/runtime/src/kmp_lock.cpp b/openmp/runtime/src/kmp_lock.cpp
index 6b4edecb2..11fa233c4 100644
--- a/openmp/runtime/src/kmp_lock.cpp
+++ b/openmp/runtime/src/kmp_lock.cpp
@@ -3243,7 +3243,7 @@ static void __kmp_destroy_indirect_lock(kmp_dyna_lock_t *lock) {
   kmp_indirect_lock_t *l =
       __kmp_lookup_indirect_lock((void **)lock, "omp_destroy_lock");
   if (l == nullptr)
-    return;     // avoid segv if lock already destroyed
+    return; // avoid segv if lock already destroyed
   KMP_I_LOCK_FUNC(l, destroy)(l->lock);
   kmp_indirect_locktag_t tag = l->type;
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/145625


More information about the Openmp-commits mailing list