From 393202b15d6851e147cbd60344d712f522655a5c Mon Sep 17 00:00:00 2001 From: hhuebner Date: Tue, 11 Nov 2025 16:50:55 +0100 Subject: [PATCH] Cast record size to uint64 to prevent overflow --- clang/lib/CIR/Dialect/IR/CIRTypes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp index 5897352829891..f7907c76c8ccb 100644 --- a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp +++ b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp @@ -341,7 +341,7 @@ RecordType::getTypeSizeInBits(const mlir::DataLayout &dataLayout, if (isUnion()) return dataLayout.getTypeSize(getLargestMember(dataLayout)); - unsigned recordSize = computeStructSize(dataLayout); + auto recordSize = static_cast(computeStructSize(dataLayout)); return llvm::TypeSize::getFixed(recordSize * 8); }