[clang] [Clang] Correct handling of negative and out-of-bounds indices (PR #71877)

Nick Desaulniers via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 17 09:41:54 PST 2023


================
@@ -827,6 +827,165 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type,
   return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true);
 }
 
+llvm::Value *
+CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type,
+                                             llvm::IntegerType *ResType) {
----------------
nickdesaulniers wrote:

it's hard to tell what changed since this patch:
1. creates `CodeGenFunction::emitFlexibleArrayMemberSize`
2. changes logic within `CodeGenFunction::emitFlexibleArrayMemberSize`

Mind pre-committing 1 so that it's easier to see what logic was changed in isolation?

https://github.com/llvm/llvm-project/pull/71877


More information about the cfe-commits mailing list