Skip to content

Commit 81ca1dc

Browse files
authored
[SYCL] Uninitialized value used with IntelNamedSubGroupSize (#7918)
A release compiler build with the memory sanitizer discovered the use of an uninitialized value in SemaDeclAttr.cpp while running the test SemaSYCL/sub-group-size.cpp. It was caused by not returning early after diagnosing invalid attribute values.
1 parent 102e154 commit 81ca1dc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4060,6 +4060,7 @@ static void handleIntelNamedSubGroupSize(Sema &S, Decl *D,
40604060
if (!IntelNamedSubGroupSizeAttr::ConvertStrToSubGroupSizeType(SizeStr,
40614061
SizeType)) {
40624062
S.Diag(Loc, diag::warn_attribute_type_not_supported) << AL << SizeStr;
4063+
return;
40634064
}
40644065
D->addAttr(IntelNamedSubGroupSizeAttr::Create(S.Context, SizeType, AL));
40654066
}

0 commit comments

Comments
 (0)