Skip to content

Commit 56c8328

Browse files
committed
check isValid for the memory type before comparing sizes
1 parent 3911865 commit 56c8328

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/CodeGen/MachineOperand.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,8 @@ void MachineMemOperand::print(raw_ostream &OS, ModuleSlotTracker &MST,
12401240
<< "unknown-address";
12411241
}
12421242
MachineOperand::printOperandOffset(OS, getOffset());
1243-
unsigned MinSize = getType().getSizeInBytes().getKnownMinValue();
1243+
uint64_t MinSize = MemoryType.isValid() ? getType().getSizeInBytes().getKnownMinValue() : ~UINT64_C(0);
1244+
// TODO: getSize should return TypeSize
12441245
if (MinSize > 0 && getAlign() != MinSize)
12451246
OS << ", align " << getAlign().value();
12461247
if (getAlign() != getBaseAlign())

0 commit comments

Comments
 (0)