aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Sarnie <nick.sarnie@intel.com>2025-06-10 16:05:53 -0400
committerGitHub <noreply@github.com>2025-06-10 20:05:53 +0000
commitb8f79f81a3fb559f93b30e1aef07cc965d2bf2b3 (patch)
tree5547da05a911388a2634ceaf67c092bcf2bb6070
parent766b3016c4527a8b23772a421d71876fe186255f (diff)
downloadllvm-b8f79f81a3fb559f93b30e1aef07cc965d2bf2b3.zip
llvm-b8f79f81a3fb559f93b30e1aef07cc965d2bf2b3.tar.gz
llvm-b8f79f81a3fb559f93b30e1aef07cc965d2bf2b3.tar.bz2
[Clang][Attr] Fix possible crash when trying to check for DeviceKernel spelling (#143546)
I didn't add a test because this can't be reproduced yet in this repo, I reproduced this only in intel's fork with more SYCL support. I also fixed some formatting. Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
-rw-r--r--clang/include/clang/Basic/Attr.td6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index bd07bb1..b8e5806 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -1612,11 +1612,11 @@ def DeviceKernel : DeclOrTypeAttr {
// list, but here we have the same spelling with unscores and without,
// so handle that case manually.
return A.getAttributeSpellingListIndex() == Keyword_kernel ||
- A.getAttrName()->getName() == "kernel";
+ (A.getAttrName() && A.getAttrName()->getName() == "kernel");
}
static inline bool isOpenCLSpelling(const AttributeCommonInfo* A) {
- if (!A) return false;
- return isOpenCLSpelling(*A);
+ if (!A) return false;
+ return isOpenCLSpelling(*A);
}
}];
}