[clang] [CIR] Fix uninitialized value which caused MSAN failure (PR #234274)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 21 09:46:45 PDT 2026


https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/234274

This failure showed up in the build bots now that we're enabled by default.  We ended up accessing an invalid index while doing label lowering ops.

>From 208154965eaed70c62f8d92ddb11f90f7076d881 Mon Sep 17 00:00:00 2001
From: erichkeane <ekeane at nvidia.com>
Date: Wed, 21 Oct 2026 09:43:04 -0700
Subject: [PATCH] [CIR] Fix uninitialized value which caused MSAN failure

This failure showed up in the build bots now that we're enabled by
default.  We ended up accessing an invalid index while doing label
lowering ops.
---
 clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.h b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.h
index c71ae0c93f9d4b..d3ef1d968f3856 100644
--- a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.h
+++ b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.h
@@ -84,7 +84,7 @@ struct LLVMBlockAddressInfo {
   // name) pair so it can be patched later.
   llvm::DenseMap<mlir::LLVM::BlockAddressOp, cir::BlockAddrInfoAttr>
       unresolvedBlockAddressOp;
-  int32_t blockTagOpIndex;
+  int32_t blockTagOpIndex = 0;
 };
 
 mlir::LogicalResult lowerToConstrainedFPIntrinsic(



More information about the cfe-commits mailing list