Add check for [EmbeddedBytecode] not having 3 arguments

このコミットが含まれているのは:
Sergio Pedri committed 2021-12-08 11:17:07 +01:00
1 親 2242f671ee
コミット e564864b6c
1ファイル変更
+2 -1
+2 -1
ファイルの表示
@@ -53,7 +53,8 @@ public sealed partial class IShaderGenerator
ImmutableArray<Diagnostic>.Builder builder = ImmutableArray.CreateBuilder<Diagnostic>();
// Validate the thread number arguments
if (attribute.ConstructorArguments[0].Value is not int threadsX ||
if (attribute.ConstructorArguments.Length != 3 ||
attribute.ConstructorArguments[0].Value is not int threadsX ||
attribute.ConstructorArguments[1].Value is not int threadsY ||
attribute.ConstructorArguments[2].Value is not int threadsZ ||
threadsX is < 1 or > 1024 ||