Skip to content

Commit 393202b

Browse files
Cast record size to uint64 to prevent overflow
1 parent 0246f33 commit 393202b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/CIR/Dialect/IR/CIRTypes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ RecordType::getTypeSizeInBits(const mlir::DataLayout &dataLayout,
341341
if (isUnion())
342342
return dataLayout.getTypeSize(getLargestMember(dataLayout));
343343

344-
unsigned recordSize = computeStructSize(dataLayout);
344+
auto recordSize = static_cast<uint64_t>(computeStructSize(dataLayout));
345345
return llvm::TypeSize::getFixed(recordSize * 8);
346346
}
347347

0 commit comments

Comments
 (0)