Skip to content

Commit 0119790

Browse files
[SYCL][Clang][NFC] Fix static analyzer concern (#10747)
Fix static analyzer concern about dereferencing null value.
1 parent bedd818 commit 0119790

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4440,7 +4440,7 @@ SYCLIntelMaxGlobalWorkDimAttr *Sema::MergeSYCLIntelMaxGlobalWorkDimAttr(
44404440
// to (1, 1, 1) in case the value of SYCLIntelMaxGlobalWorkDimAttr equals to
44414441
// 0.
44424442
const auto *MergeExpr = dyn_cast<ConstantExpr>(A.getValue());
4443-
if (MergeExpr->getResultAsAPSInt() == 0) {
4443+
if (MergeExpr && MergeExpr->getResultAsAPSInt() == 0) {
44444444
if (checkWorkGroupSizeAttrExpr<SYCLIntelMaxWorkGroupSizeAttr>(*this, D,
44454445
A) ||
44464446
checkWorkGroupSizeAttrExpr<SYCLReqdWorkGroupSizeAttr>(*this, D, A))

0 commit comments

Comments
 (0)