From 27a63e22df2ecb558eb4baf6d37c8a50245cd33b Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Mon, 3 Jul 2023 10:43:22 -0700 Subject: [PATCH] for now, do not permit non-library-profile blobs with a CompilerVersion part. --- lib/HLSL/DxilValidation.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/HLSL/DxilValidation.cpp b/lib/HLSL/DxilValidation.cpp index c9ec5bc0f8..9f95bc5661 100644 --- a/lib/HLSL/DxilValidation.cpp +++ b/lib/HLSL/DxilValidation.cpp @@ -5731,13 +5731,16 @@ HRESULT ValidateDxilContainerParts(llvm::Module *pModule, VerifyFeatureInfoMatches(ValCtx, GetDxilPartData(pPart), pPart->PartSize); break; case DFCC_CompilerVersion: - // Either this blob is a PDB, or it is a library with shader model at least 6.8 + // This blob is either a PDB, or a library profile if (ValCtx.isLibProfile) { if (!ValidateCompilerVersionPart((void *)GetDxilPartData(pPart), pPart->PartSize)) { - ValCtx.EmitFormatError(ValidationRule::ContainerPartInvalid, { szFourCC }); + ValCtx.EmitFormatError(ValidationRule::ContainerPartInvalid, { szFourCC }); } } + else { + ValCtx.EmitFormatError(ValidationRule::ContainerPartInvalid, { szFourCC }); + } break; case DFCC_RootSignature: