This causes incorrect stack frame allocation when the last object is an array allocat...
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Sun, 15 Mar 2009 23:28:07 +0000 (23:28 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Sun, 15 Mar 2009 23:28:07 +0000 (23:28 +0000)
the compiled program to run over its stack. Thanks to Gil Dogon

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67034 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MipsRegisterInfo.cpp

index 8a468d1db5c601057bf53e5cf9232e5641eb9e61..a33e2c2c56323b9a84c1471c939a750b644fcbbf 100644 (file)
@@ -267,7 +267,7 @@ void MipsRegisterInfo::adjustMipsStackFrame(MachineFunction &MF) const
 
   if (LastOffsetFI >= 0)
     StackOffset = MFI->getObjectOffset(LastOffsetFI)+ 
-                  MFI->getObjectAlignment(LastOffsetFI);
+                  MFI->getObjectSize(LastOffsetFI);
   StackOffset = ((StackOffset+StackAlign-1)/StackAlign*StackAlign);
 
   for (unsigned i = 0, e = CSI.size(); i != e ; ++i) {