-
Notifications
You must be signed in to change notification settings - Fork 15k
[ASan] Do not instrument catch block parameters on Windows #159618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
davidmrdavid
merged 22 commits into
llvm:main
from
davidmrdavid:dev/dajusto/dont-asanize-catch-params-on-windows
Oct 17, 2025
Merged
Changes from 5 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ece2a2b
do not asan-instrument catch parameters on windows
davidmrdavid bff409d
add basic unit test: catches exception 'inline' and in another frame
davidmrdavid 043848d
apply clang-format on `compiler-rt/test/asan/TestCases/Windows/basic_…
davidmrdavid 2326be0
optimization: disable catch-parameter instrumentation via a linear pa…
davidmrdavid 3497540
Merge branch 'main' into dev/dajusto/dont-asanize-catch-params-on-win…
davidmrdavid e4551b1
add IR instrumentation unit test with `opt`
davidmrdavid 9b99935
Merge branch 'dev/dajusto/dont-asanize-catch-params-on-windows' of ht…
davidmrdavid 04956f9
Merge branch 'main' into dev/dajusto/dont-asanize-catch-params-on-win…
davidmrdavid 65f1741
remove unecessary braces in if-statement
davidmrdavid fe312ec
minimize `.ll` test
davidmrdavid a44a340
Merge branch 'dev/dajusto/dont-asanize-catch-params-on-windows' of ht…
davidmrdavid bd511b5
remove braces from the 'for' loop
davidmrdavid c5a0e78
Merge branch 'main' into dev/dajusto/dont-asanize-catch-params-on-win…
davidmrdavid 992a650
Merge branch 'main' into dev/dajusto/dont-asanize-catch-params-on-win…
davidmrdavid 0dec61a
Update llvm/test/Instrumentation/AddressSanitizer/asan-win-dont-instr…
davidmrdavid 112f078
Update llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
davidmrdavid 2f544df
add newline to runtime test
davidmrdavid 980e31d
follow convention: move lit commands to start of backend unit test
davidmrdavid 7d93177
Merge branch 'main' into dev/dajusto/dont-asanize-catch-params-on-win…
davidmrdavid 7fe17b5
Merge branch 'main' into dev/dajusto/dont-asanize-catch-params-on-win…
davidmrdavid 98217a4
Update llvm/test/Instrumentation/AddressSanitizer/asan-win-dont-instr…
davidmrdavid 4b88967
Merge branch 'main' into dev/dajusto/dont-asanize-catch-params-on-win…
davidmrdavid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
compiler-rt/test/asan/TestCases/Windows/basic_exception_handling.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // RUN: %clangxx_asan %s -o %t | ||
davidmrdavid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // RUN: %run %t | FileCheck %s | ||
|
|
||
| // This test tests that declaring a parameter in a catch-block does not produce a false positive | ||
| // ASan error on Windows. | ||
|
|
||
| // This code is based on the repro in https://github.com/google/sanitizers/issues/749 | ||
| #include <cstdio> | ||
| #include <exception> | ||
|
|
||
| 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 | ||
| } | ||
|
|
||
| // case 2: throw in function | ||
| try { | ||
| throwInFunction(); | ||
| } catch (const std::exception &ex) { | ||
| puts(ex.what()); | ||
| // CHECK: test2 | ||
| } | ||
|
|
||
| printf("Success!\n"); | ||
| // CHECK: Success! | ||
| return 0; | ||
| } | ||
davidmrdavid marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.