[PATCH] D151040: [NFC][CLANG] Fix static code analyzer concerns

Soumi Manna via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 22 07:08:01 PDT 2023


Manna updated this revision to Diff 524291.
Manna added a comment.

Thank you @erichkeane for reviews. I have updated patch to avoid regression if the LValue doesn't evaluate right.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151040/new/

https://reviews.llvm.org/D151040

Files:
  clang/lib/AST/ExprConstant.cpp


Index: clang/lib/AST/ExprConstant.cpp
===================================================================
--- clang/lib/AST/ExprConstant.cpp
+++ clang/lib/AST/ExprConstant.cpp
@@ -10174,6 +10174,8 @@
   if (!EvaluateLValue(E->getSubExpr(), Array, Info))
     return false;
 
+  assert(ArrayType && "unexpected type for array initializer");
+
   // Get a pointer to the first element of the array.
   Array.addArray(Info, E, ArrayType);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151040.524291.patch
Type: text/x-patch
Size: 438 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230522/4788186e/attachment.bin>


More information about the cfe-commits mailing list