[clang] [compiler-rt] [ubsan_minimal] Allow UBSan handler from Minimal runtime to acceprt arguments (PR #152192)

via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 5 12:54:01 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 c,cpp -- compiler-rt/test/ubsan_minimal/TestCases/misalignment.cpp compiler-rt/test/ubsan_minimal/TestCases/null.cpp clang/lib/CodeGen/CGExpr.cpp compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp compiler-rt/test/ubsan_minimal/TestCases/override-callback.c
``````````

</details>

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

``````````diff
diff --git a/compiler-rt/test/ubsan_minimal/TestCases/misalignment.cpp b/compiler-rt/test/ubsan_minimal/TestCases/misalignment.cpp
index e5780b5b3..f0b6a7355 100644
--- a/compiler-rt/test/ubsan_minimal/TestCases/misalignment.cpp
+++ b/compiler-rt/test/ubsan_minimal/TestCases/misalignment.cpp
@@ -1,14 +1,14 @@
 // RUN: %clang_min_runtime -fsanitize=alignment %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK
 
-void f(int& n) {}
+void f(int &n) {}
 
-int* t;
+int *t;
 
 int main() {
-    int r;
-    t = (int*)(((char*)&r) + 1);
-    // CHECK: ubsan: type-mismatch by 0x{{[[:xdigit:]]+}} address 0x{{[[:xdigit:]]+$}}
-    // CHECK-NOT: type-mismatch
+  int r;
+  t = (int *)(((char *)&r) + 1);
+  // CHECK: ubsan: type-mismatch by 0x{{[[:xdigit:]]+}} address 0x{{[[:xdigit:]]+$}}
+  // CHECK-NOT: type-mismatch
 
-    f(*t);
+  f(*t);
 }
\ No newline at end of file
diff --git a/compiler-rt/test/ubsan_minimal/TestCases/null.cpp b/compiler-rt/test/ubsan_minimal/TestCases/null.cpp
index 19bc880bc..73927834c 100644
--- a/compiler-rt/test/ubsan_minimal/TestCases/null.cpp
+++ b/compiler-rt/test/ubsan_minimal/TestCases/null.cpp
@@ -1,11 +1,11 @@
 // RUN: %clang_min_runtime -fsanitize=null %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK
 
-void f(int& n) {}
+void f(int &n) {}
 
-int* t;
+int *t;
 
 int main() {
-    // CHECK: ubsan: type-mismatch by 0x{{[[:xdigit:]]+}} address 0x{{[[:xdigit:]]+$}}
-    // CHECK-NOT: type-mismatch
-    f(*t);
+  // CHECK: ubsan: type-mismatch by 0x{{[[:xdigit:]]+}} address 0x{{[[:xdigit:]]+$}}
+  // CHECK-NOT: type-mismatch
+  f(*t);
 }
\ No newline at end of file

``````````

</details>


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


More information about the cfe-commits mailing list