From 943513b79929fba1a9dccdf81cb68a41ce29cd03 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Tue, 26 Nov 2019 22:41:40 +0200 Subject: [X86] [Win64] Avoid truncating large (> 32 bit) stack allocations This fixes PR44129, which was broken in a7adc3185b (in 7.0.0 and newer). Differential Revision: https://reviews.llvm.org/D70741 --- llvm/lib/Target/X86/X86FrameLowering.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Target/X86/X86FrameLowering.cpp') diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp index 3374cd054a6..799c1f5d128 100644 --- a/llvm/lib/Target/X86/X86FrameLowering.cpp +++ b/llvm/lib/Target/X86/X86FrameLowering.cpp @@ -1261,7 +1261,7 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF, if (Is64Bit) { // Handle the 64-bit Windows ABI case where we need to call __chkstk. // Function prologue is responsible for adjusting the stack pointer. - int Alloc = isEAXAlive ? NumBytes - 8 : NumBytes; + int64_t Alloc = isEAXAlive ? NumBytes - 8 : NumBytes; if (isUInt<32>(Alloc)) { BuildMI(MBB, MBBI, DL, TII.get(X86::MOV32ri), X86::EAX) .addImm(Alloc) -- cgit v1.2.3