-
Notifications
You must be signed in to change notification settings - Fork 715
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
[Sema] Check FunctionDecl has identifier before getName. #6439
Merged
Conversation
This file contains 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
…ifier. Use identifier name without check the identifier exists will cause crash. Fixes microsoft#6426
For your test case, I would think only one function declaration is needed. Is it possible to get rid of the rest of them? |
tex3d
reviewed
Mar 20, 2024
Co-authored-by: Tex Riddell <[email protected]>
You can test this locally with the following command:git-clang-format --diff 6f4f758e9b3be1991956f99600982755596e29dc 176e467ed36741b9d9f2c13ea6bb9666ab66af5c -- tools/clang/lib/Sema/SemaHLSL.cpp View the diff from clang-format here.diff --git a/tools/clang/lib/Sema/SemaHLSL.cpp b/tools/clang/lib/Sema/SemaHLSL.cpp
index 3646e35d8..4f3caee35 100644
--- a/tools/clang/lib/Sema/SemaHLSL.cpp
+++ b/tools/clang/lib/Sema/SemaHLSL.cpp
@@ -15690,7 +15690,8 @@ 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 (!FD->getIdentifier() || EntryPointName != FD->getIdentifier()->getName()) {
+ if (!FD->getIdentifier() ||
+ EntryPointName != FD->getIdentifier()->getName()) {
return;
}
|
llvm-beanz
approved these changes
Mar 21, 2024
tex3d
approved these changes
Mar 21, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
python3kgae
added a commit
that referenced
this pull request
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 pull request
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)
pow2clk
added a commit
that referenced
this pull request
Jul 16, 2024
Merges the following changes into mesh nodes to fix a known bug that required a point release in the march release branch and also some build fixes for new visual studio diagnostics. 9ca52f4 Add duplicate pragma (#6732) 7809c0b Remove Windows C++ redist hack (#6692) 33277a1 Workaround broken GitHub runner images (#6683) 1b9a796 [Sema] Check FunctionDecl has identifier before getName. (#6439) (#6457)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Use identifier name without check the identifier exists will cause crash.
Fixes #6426