summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-03-27 09:39:46 +0000
committerPavel Labath <pavel@labath.sk>2019-03-27 09:39:46 +0000
commitcf6c19c2d35c4dc22fc6e3c405ab7a4071848fc2 (patch)
tree54c6f58a2accdea563e7fa008a5c6dce08d098a9
parent3f2e29b013722e129b470fb62a071d05fdcff468 (diff)
downloadbcm5719-llvm-cf6c19c2d35c4dc22fc6e3c405ab7a4071848fc2.tar.gz
bcm5719-llvm-cf6c19c2d35c4dc22fc6e3c405ab7a4071848fc2.zip
Fix an out-of-bounds error in RegisterContextDarwin_arm64
Summary: gcc diagnoses this as "array subscript 63 is above array bounds of 'RegisterContextDarwin_arm64::VReg [32]'". The correct fix seems to be subtracting the fpu register base index, but I have no way of verifying that this actually works. Reviewers: jasonmolenda Subscribers: javed.absar, kristof.beyls, lldb-commits Differential Revision: https://reviews.llvm.org/D59495 llvm-svn: 357055
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
index 308cf151909..0f9e1e6b758 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
@@ -429,7 +429,7 @@ bool RegisterContextDarwin_arm64::ReadRegister(const RegisterInfo *reg_info,
case fpu_v29:
case fpu_v30:
case fpu_v31:
- value.SetBytes(fpu.v[reg].bytes.buffer, reg_info->byte_size,
+ value.SetBytes(fpu.v[reg - fpu_v0].bytes.buffer, reg_info->byte_size,
endian::InlHostByteOrder());
break;
@@ -621,7 +621,8 @@ bool RegisterContextDarwin_arm64::WriteRegister(const RegisterInfo *reg_info,
case fpu_v29:
case fpu_v30:
case fpu_v31:
- ::memcpy(fpu.v[reg].bytes.buffer, value.GetBytes(), value.GetByteSize());
+ ::memcpy(fpu.v[reg - fpu_v0].bytes.buffer, value.GetBytes(),
+ value.GetByteSize());
break;
case fpu_fpsr:
OpenPOWER on IntegriCloud