Skip to content

Commit f8a5602

Browse files
committed
Fix KhronosGroup#2385: guard against constant_id on non-const.
1 parent 759ae5a commit f8a5602

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

glslang/HLSL/hlslParseHelper.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,6 +1953,10 @@ void HlslParseContext::transferTypeAttributes(const TSourceLoc& loc, const TAttr
19531953
break;
19541954
case EatConstantId:
19551955
// specialization constant
1956+
if (type.getQualifier().storage != EvqConst) {
1957+
error(loc, "needs a const type", "constant_id", "");
1958+
break;
1959+
}
19561960
if (it->getInt(value)) {
19571961
TSourceLoc loc;
19581962
loc.init();

0 commit comments

Comments
 (0)