[compiler-rt] [llvm] [ASan] Do not instrument catch block parameters on Windows (PR #159618)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 18 11:03:34 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 origin/main HEAD --extensions cpp -- compiler-rt/test/asan/TestCases/Windows/basic_exception_handling.cpp llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
``````````

: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/compiler-rt/test/asan/TestCases/Windows/basic_exception_handling.cpp b/compiler-rt/test/asan/TestCases/Windows/basic_exception_handling.cpp
index 94ca4b9bf..f8dd49e64 100644
--- a/compiler-rt/test/asan/TestCases/Windows/basic_exception_handling.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/basic_exception_handling.cpp
@@ -8,29 +8,26 @@
 #include <cstdio>
 #include <exception>
 
-void throwInFunction(){
-    throw std::exception("test2");
-}
+void throwInFunction() { throw std::exception("test2"); }
 
-int main()
-{
-    // case 1: direct throw
-	try	{
-		throw std::exception("test1");
-	} catch (const std::exception& ex){
-		puts(ex.what());
-        // CHECK: test1
-	}
+int main() {
+  // case 1: direct throw
+  try {
+    throw std::exception("test1");
+  } catch (const std::exception &ex) {
+    puts(ex.what());
+    // CHECK: test1
+  }
 
-    // case 2: throw in function
-    try {
-        throwInFunction();
-    } catch (const std::exception& ex){
-        puts(ex.what());
-        // CHECK: test2
-    }
+  // case 2: throw in function
+  try {
+    throwInFunction();
+  } catch (const std::exception &ex) {
+    puts(ex.what());
+    // CHECK: test2
+  }
 
-    printf("Success!\n");
-    // CHECK: Success!
-	return 0;
+  printf("Success!\n");
+  // CHECK: Success!
+  return 0;
 }
\ No newline at end of file

``````````

</details>


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


More information about the llvm-commits mailing list