2
0
Эх сурвалжийг харах

Fix external validator crash on empty struct (#2323)

Fixes #2322
Helena Kotas 6 жил өмнө
parent
commit
e3cf6b6ed9

+ 1 - 1
lib/HLSL/DxilValidation.cpp

@@ -3772,7 +3772,7 @@ CollectCBufferRanges(DxilStructAnnotation *annotation,
           CollectCBufferRanges(EltAnnotation, constAllocator,
                                structBase, typeSys, cbName, ValCtx);
         } else {
-          if (nullptr != constAllocator.Insert(
+          if (EltSize > 0 && nullptr != constAllocator.Insert(
                 &fieldAnnotation, structBase, structBase + EltSize - 1)) {
             ValCtx.EmitFormatError(
                 ValidationRule::SmCBufferOffsetOverlap,