-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Clang crashes when having destructor called inside __except
block with--async-exceptions
#82917
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
Comments
@llvm/issue-subscribers-backend-x86 Author: None (m4arhz)
Here is the code and options I used to reproduce the problem: https://godbolt.org/z/8r8TYsbq7
While the code crashes at `calculateSEHStateForAsynchEH` I believe the actual problem is at `EHScopeStack`. There are two type of `SEH` scopes, `llvm.seh.try` and `llvm.seh.scope`, the problem seem to be that the scope of the temporary starts with `llvm.seh.scope.begin` and ends with `llvm.seh.try.end` which causes the crash.
Anyone knows which type of `SEH` scope should the temporary have?
|
Still crashes in |
Even simpler example: https://godbolt.org/z/z6TWY6r4q |
I think it's |
@llvm/issue-subscribers-clang-frontend Author: None (m4arhz)
Here is the code and options I used to reproduce the problem: https://godbolt.org/z/8r8TYsbq7
While the code crashes at `calculateSEHStateForAsynchEH` I believe the actual problem is at `EHScopeStack`. There are two type of `SEH` scopes, `llvm.seh.try` and `llvm.seh.scope`, the problem seem to be that the scope of the temporary starts with `llvm.seh.scope.begin` and ends with `llvm.seh.try.end` which causes the crash.
Anyone knows which type of `SEH` scope should the temporary have?
|
Looks like it should be an early failure instead of a crash: https://godbolt.org/z/TYKcM47K5 |
Thanks for the info! I think these check should be done in the front end SemaCheck part. |
I also ran into this, it shouldn't be an error if c++ exceptions are disabled (it's not on msvc either if you pass |
That's the currect difference between Clang and MSVC and we should improve it, see #62606 |
Looks like it does work if it is changed to not emit them at all when c++ exceptions are disabled, that's probably a decent solution along with a sema check for the other case when c++ exceptions are enabled. |
Here is the code and options I used to reproduce the problem: https://godbolt.org/z/8r8TYsbq7
While the code crashes at
calculateSEHStateForAsynchEH
I believe the actual problem is atEHScopeStack
. There are two type ofSEH
scopes,llvm.seh.try
andllvm.seh.scope
, the problem seem to be that the scope of the temporary starts withllvm.seh.scope.begin
and ends withllvm.seh.try.end
which causes the crash.Anyone knows which type of
SEH
scope should the temporary have?The text was updated successfully, but these errors were encountered: