Fix off-by-one error.

llvm-svn: 148077
This commit is contained in:
Bill Wendling 2012-01-13 00:41:53 +00:00
parent 728db4997a
commit 9c8456f7ef
1 changed files with 1 additions and 1 deletions

View File

@ -458,7 +458,7 @@ encodeCompactUnwindRegistersWithFrame(unsigned SavedRegs[CU_NUM_SAVED_REGS],
// Encode the registers in the order they were saved, 3-bits per register. The
// registers are numbered from 1 to CU_NUM_SAVED_REGS.
uint32_t RegEnc = 0;
for (int I = CU_NUM_SAVED_REGS, Idx = 0; I != -1; --I) {
for (int I = CU_NUM_SAVED_REGS - 1, Idx = 0; I != -1; --I) {
unsigned Reg = SavedRegs[I];
if (Reg == 0) continue;