-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Fix crash due to incorrect ReinterpretCastExpr
generation
#7030
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
Conversation
When creating `ReinterpretCastExpr` use `getTrivialTypeSourceInfo` instead of `CreateTypeSourceInfo` since `CreateTypeSourceInfo` doesn't initialize underlying memory. The crash appeared during recursive AST visitors walks if kernel argument type had a nested name specifier.
This change looks good. Do we have CodeGen tests that check the initialization itself (its presence) so we could have caught it earlier? |
I don't think we had any test with nested types as arguments (either Sema or CodeGen) which is why we never caught this. This Sema test should be enough to test current crash but I agree it makes sense to add a test to check initialization as well - whether CodeGen or Sema |
Should this test be added as part of this PR or it can be added separately? |
Since its related to this fix, I think we can add it in this PR unless it will delay patch significantly. |
Ok, done. |
I suppose the new tests failed because b91b732 was merged. Will do a fix shortly. |
This broke Clang :: SemaSYCL/built-in-type-kernel-arg.cpp on Windows. Will do a fix shortly. |
On Windows kernel names are mangled in a different way.
When creating
ReinterpretCastExpr
usegetTrivialTypeSourceInfo
instead ofCreateTypeSourceInfo
sinceCreateTypeSourceInfo
doesn't initialize underlying memory. The crash appeared during recursive AST visitors walks if kernel argument type had a nested name specifier.