diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-03-30 23:44:13 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-03-30 23:44:13 +0000 |
commit | ee2e0e347e253d103ebbb0c59fcb48ca2d80b7ef (patch) | |
tree | 0382ec160f8cd1103546221f2dd5b50424477a95 /lib/Target/ARM/ARMISelLowering.cpp | |
parent | 40829ed6f5e449fa33a9cd7022ce6c3941dace3d (diff) |
Don't try to create zero-sized stack objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128586 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r-- | lib/Target/ARM/ARMISelLowering.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index 11ff6bf965..16b110f39b 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -2391,8 +2391,9 @@ ARMTargetLowering::LowerFormalArguments(SDValue Chain, // In case of tail call optimization mark all arguments mutable. Since they // could be overwritten by lowering of arguments in case of a tail call. if (Flags.isByVal()) { - int FI = MFI->CreateFixedObject(Flags.getByValSize(), - VA.getLocMemOffset(), false); + unsigned Bytes = Flags.getByValSize(); + if (Bytes == 0) Bytes = 1; // Don't create zero-sized stack objects. + int FI = MFI->CreateFixedObject(Bytes, VA.getLocMemOffset(), false); InVals.push_back(DAG.getFrameIndex(FI, getPointerTy())); } else { int FI = MFI->CreateFixedObject(VA.getLocVT().getSizeInBits()/8, |