================
@@ -4284,6 +4284,9 @@ bool SemaHLSL::transformInitList(const InitializedEntity 
&Entity,
   }
   size_t ExpectedSize = ILT.DestTypes.size();
   size_t ActualSize = ILT.ArgExprs.size();
+  if (ExpectedSize == 0 && ActualSize == 0)
----------------
shafik wrote:

So this check is a little troubling b/c we have a divide by `ExpectedSize` not 
to far below here and based on this condition `ExpectedSize` can be `0` and it 
is undefined behavior to divide by zero.

So if there are more conditions here not represented in the code we should add 
assertions to document the invariants. 

CC @llvm-beanz 

https://github.com/llvm/llvm-project/pull/160355
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to