[clang] [CIR][CodeGen] Support DesignatedInitUpdateExpr in constant emission (PR #194238)

via cfe-commits cfe-commits at lists.llvm.org
Tue May 5 10:19:07 PDT 2026


================
@@ -669,7 +781,7 @@ bool ConstRecordBuilder::build(InitListExpr *ile, bool allowOverwrite) {
       continue;
     }
 
-    if (zeroInitPadding &&
+    if (zeroInitPadding && !allowOverwrite &&
----------------
AbdallahRashed wrote:

because in NoInitExpr the applyZeroInitPadding was not called we were just skipping it, so advancing
sizeSoFar also skipped, which lead to applyZeroInitPadding corrupting and overwrite the base data, this flag was workaround but I check the classic codegen and I found that the proper fix is to call applyZeroInitPadding for NoInitExpr fields too, fixed now 

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


More information about the cfe-commits mailing list