unwind: fix invalid memory access
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 21 Aug 2015 03:21:31 +0000 (03:21 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 21 Aug 2015 03:21:31 +0000 (03:21 +0000)
Fix out-of-bounds array access when setting arm float registers.

Patch by Leandro GraciĆ” Gil!

llvm-svn: 245665

libunwind/src/Registers.hpp

index 4a441b7..d01ebf0 100644 (file)
@@ -1689,7 +1689,7 @@ inline void Registers_arm::setFloatRegister(int regNum, unw_fpreg_t value) {
       _saved_vfp_d16_d31 = true;
       saveVFPv3(_vfp_d16_d31);
     }
-    _vfp_d16_d31[regNum - UNW_ARM_D0] = value;
+    _vfp_d16_d31[regNum - UNW_ARM_D16] = value;
   } else if (regNum >= UNW_ARM_WR0 && regNum <= UNW_ARM_WR15) {
     if (!_saved_iwmmx) {
       _saved_iwmmx = true;