From: Eric Christopher Date: Thu, 23 Jan 2014 21:41:10 +0000 (+0000) Subject: Fix out of bounds access to the double regs array. Given the X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=22221ee0e33b6b992aca34c80bf3bee1fc507ff6;p=oota-llvm.git Fix out of bounds access to the double regs array. Given the code this looks correct, but could use review. The previous was definitely not correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199940 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp b/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp index 8234e5df8af..07758894775 100644 --- a/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp +++ b/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp @@ -734,7 +734,7 @@ bool SparcAsmParser::matchRegisterName(const AsmToken &Tok, && !name.substr(1, 2).getAsInteger(10, intVal) && intVal >= 32 && intVal <= 62 && (intVal % 2 == 0)) { // FIXME: Check V9 - RegNo = DoubleRegs[16 + intVal/2]; + RegNo = DoubleRegs[intVal/2]; RegKind = SparcOperand::rk_DoubleReg; return true; }