================
@@ -200,6 +200,14 @@ static bool isDeterminedByInterestingSymbol(SVal SV,
   return false;
 }
 
+static int64_t getElementSize(const ElementRegion *ER, SValBuilder &SVB) {
+  QualType ElemType = ER->getElementType();
+
+  assert(!ElemType->isIncompleteType() && "ElemType cannot be incomplete");
----------------
NagyDonat wrote:

I'm pretty sure that the element type of an `ElementRegion` can never be an 
incomplete type. In particular, the `ArrayBound` checker activates for 
subscript expressions, pointer dereference and the arrow operator, and neither 
of these compiles when the element type is incomplete.

One or two years ago investigated this and came to the conclusion that the `if` 
was superfluous, but left it in place because I didn't see an immediate need. 
Now I replaced the `if` with an assert because I had to refactor the code and 
keeping an `if` would have been uncomfortable.

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

Reply via email to