[Openmp-commits] [openmp] [OpenMP] Fix use of uninitialized Dl_info when dladdr fails in ompd_init (PR #193643)
via Openmp-commits
openmp-commits at lists.llvm.org
Wed Apr 22 19:06:11 PDT 2026
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 origin/main HEAD --extensions cpp -- openmp/runtime/src/ompd-specific.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/openmp/runtime/src/ompd-specific.cpp b/openmp/runtime/src/ompd-specific.cpp
index b0503f1d2..dadfb26e0 100644
--- a/openmp/runtime/src/ompd-specific.cpp
+++ b/openmp/runtime/src/ompd-specific.cpp
@@ -89,8 +89,7 @@ void ompd_init() {
if (!ret) {
fprintf(stderr, "%s\n", dlerror());
} else if (strrchr(dl_info.dli_fname, '/')) {
- int lib_path_length =
- strrchr(dl_info.dli_fname, '/') - dl_info.dli_fname;
+ int lib_path_length = strrchr(dl_info.dli_fname, '/') - dl_info.dli_fname;
libname =
(char *)malloc(lib_path_length + 12 /*for '/libompd.so' and '\0'*/);
strncpy(libname, dl_info.dli_fname, lib_path_length);
``````````
</details>
https://github.com/llvm/llvm-project/pull/193643
More information about the Openmp-commits
mailing list