summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2014-01-23 21:41:10 +0000
committerEric Christopher <echristo@gmail.com>2014-01-23 21:41:10 +0000
commit7383d4a9c5ed9bd90a3dab039fa0bf8efb687748 (patch)
tree545a36486bf54cc51eeb1ffc2675460f785d63b0 /llvm/lib/Target/Sparc
parent1f4db7da8fa4e3c8e0b7ac9807abc7905675c61f (diff)
downloadbcm5719-llvm-7383d4a9c5ed9bd90a3dab039fa0bf8efb687748.tar.gz
bcm5719-llvm-7383d4a9c5ed9bd90a3dab039fa0bf8efb687748.zip
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. llvm-svn: 199940
Diffstat (limited to 'llvm/lib/Target/Sparc')
-rw-r--r--llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp b/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
index 8234e5df8af..07758894775 100644
--- a/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud