From a8c63f0fc9feb48f17d702a907f065959c41e337 Mon Sep 17 00:00:00 2001 From: Bruno Cardoso Lopes Date: Tue, 3 Jun 2008 08:46:59 +0000 Subject: [PATCH] Fixed bug in bad behavior in calculateFrameObjectOffsets, the solution commited is different from the previous patch to avoid int and unsigned comparison git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51899 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/PrologEpilogInserter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp index fda08bc29f6..c52da321c1e 100644 --- a/lib/CodeGen/PrologEpilogInserter.cpp +++ b/lib/CodeGen/PrologEpilogInserter.cpp @@ -362,7 +362,8 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) { FFI->setObjectOffset(i, -Offset); // Set the computed offset } } else { - for (unsigned i = MaxCSFrameIndex; i >= MinCSFrameIndex; --i) { + int MaxCSFI = MaxCSFrameIndex, MinCSFI = MinCSFrameIndex; + for (int i = MaxCSFI; i >= MinCSFI ; --i) { unsigned Align = FFI->getObjectAlignment(i); // If the alignment of this object is greater than that of the stack, then // increase the stack alignment to match.