-
Notifications
You must be signed in to change notification settings - Fork 712
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
Regression, SIGSEGV instead of diagnostics when encountering bool operator==(const T&, const T&) #6426
Labels
Milestone
Comments
damyanp
added
incorrect-code
Issues relating to handling of incorrect code
and removed
needs-triage
Awaiting triage
labels
Mar 18, 2024
We also find that the compiler crashes in the non-spirv case as well, so we should have a look into this before declaring it spir-v specific. |
damyanp
changed the title
[SPIRV] Regression, SIGSEGV instead of diagnostics when encountering bool operator==(const T&, const T&)
[SPIR-V] Regression, SIGSEGV instead of diagnostics when encountering bool operator==(const T&, const T&)
Mar 18, 2024
Minimal reproducible example:
|
The fix for this is pretty straightforward: diff --git a/tools/clang/lib/Sema/SemaHLSL.cpp b/tools/clang/lib/Sema/SemaHLSL.cpp
index 31ff6a45851..704824c3822 100644
--- a/tools/clang/lib/Sema/SemaHLSL.cpp
+++ b/tools/clang/lib/Sema/SemaHLSL.cpp
@@ -15690,7 +15690,7 @@ void TryAddShaderAttrFromTargetProfile(Sema &S, FunctionDecl *FD,
// if this FD isn't the entry point, then we shouldn't add
// a shader attribute to this decl, so just return
- if (EntryPointName != FD->getIdentifier()->getName()) {
+ if (FD->getIdentifier() && EntryPointName != FD->getIdentifier()->getName()) {
return;
} We should craft some wider test cases too. |
pow2clk
changed the title
[SPIR-V] Regression, SIGSEGV instead of diagnostics when encountering bool operator==(const T&, const T&)
Regression, SIGSEGV instead of diagnostics when encountering bool operator==(const T&, const T&)
Mar 20, 2024
python3kgae
added a commit
that referenced
this issue
Mar 21, 2024
Use identifier name without check the identifier exists will cause crash. Fixes #6426 --------- Co-authored-by: Tex Riddell <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Re-opening this to track getting the fix cherry-picked into the next point release. |
python3kgae
added a commit
that referenced
this issue
Mar 26, 2024
Use identifier name without check the identifier exists will cause crash. Fixes #6426 --------- Co-authored-by: Tex Riddell <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> (cherry picked from commit 7581ff4)
pow2clk
pushed a commit
to pow2clk/DirectXShaderCompiler
that referenced
this issue
Jul 15, 2024
) (microsoft#6457) Use identifier name without check the identifier exists will cause crash. Fixes microsoft#6426 --------- Co-authored-by: Tex Riddell <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> (cherry picked from commit 7581ff4) (cherry picked from commit 11e1318)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Description
SIGSEGV instead of diagnostics when encountering
bool operator==(const T&, const T&)
Steps to reproduce:
Godbolt link: https://godbolt.org/z/5hsxeK5aE
The text was updated successfully, but these errors were encountered: