[compiler-rt] [msan] Support prctl PR_GET_NAME call (PR #98951)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 15 13:11:00 PDT 2024
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 e6ec7c8f74d1be778f4ddf794d0e2fb63b0dc3be 7647832a9dbfe161839243697a20d2798826451a --extensions inc,cpp -- compiler-rt/test/msan/prctl.cpp compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
index cc5f0f3c8b..4253356827 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -1267,15 +1267,16 @@ INTERCEPTOR(int, prctl, int option, unsigned long arg2, unsigned long arg3,
COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, buff);
} else if (res != 1 && option == PR_GET_NAME) {
unsigned long null_index = 0;
- char* name = (char*)arg2;
+ char *name = (char *)arg2;
while (name[null_index] && null_index < 16) {
++null_index;
}
if (null_index > 15) {
null_index = 15;
}
- COMMON_INTERCEPTOR_WRITE_RANGE(ctx, (u64*)arg2, null_index+1);
- } else if (res != -1 && option == PR_SCHED_CORE && arg2 == PR_SCHED_CORE_GET) {
+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, (u64 *)arg2, null_index + 1);
+ } else if (res != -1 && option == PR_SCHED_CORE &&
+ arg2 == PR_SCHED_CORE_GET) {
COMMON_INTERCEPTOR_WRITE_RANGE(ctx, (u64*)(arg5), sizeof(u64));
}
return res;
``````````
</details>
https://github.com/llvm/llvm-project/pull/98951
More information about the llvm-commits
mailing list