Skip to content

Commit 997eae3

Browse files
authored
[AsmPrinter] Increase upper bound for size in global structs
This is part of the fixes to address llvm#57353 https://reviews.llvm.org/D133845 Pull Request: llvm#92334
1 parent e5e5623 commit 997eae3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3501,7 +3501,7 @@ static void emitGlobalConstantStruct(const DataLayout &DL,
35013501
const Constant *BaseCV, uint64_t Offset,
35023502
AsmPrinter::AliasMapTy *AliasList) {
35033503
// Print the fields in successive locations. Pad to align if needed!
3504-
unsigned Size = DL.getTypeAllocSize(CS->getType());
3504+
uint64_t Size = DL.getTypeAllocSize(CS->getType());
35053505
const StructLayout *Layout = DL.getStructLayout(CS->getType());
35063506
uint64_t SizeSoFar = 0;
35073507
for (unsigned I = 0, E = CS->getNumOperands(); I != E; ++I) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
; RUN: llc < %s -mtriple=x86_64 | FileCheck %s
2+
3+
; CHECK-LABEL: bad_int:
4+
; CHECK-NEXT: .long 1
5+
; CHECK-NEXT: .zero 4294967292
6+
; CHECK-NEXT: .size bad_int, 4294967296
7+
@bad_int = global <{ i32, [1073741823 x i32] }> <{ i32 1, [1073741823 x i32] zeroinitializer }>, align 16

0 commit comments

Comments
 (0)