From 6f59f302e4358b4dc869bc298c2b9c06aa716b60 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 18 Oct 2022 11:11:20 +0200 Subject: [PATCH] [lldb] Fix m_hwp_regs size for ppc64le (PR54520) The size of the m_hwp_regs array should match the default value of m_max_hwp_supported. This ensures that no out-of-bounds accesses occur, even if the array is accessed prior to a call to ReadHardwareDebugInfo(). Fixes https://github.com/llvm/llvm-project/issues/54520, see also there for additional background. Differential Revision: https://reviews.llvm.org/D136144 --- lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h index fac3958..942c65f 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h @@ -122,7 +122,7 @@ private: int mode; // Defines if watchpoint is read/write/access. }; - std::array m_hwp_regs; + std::array m_hwp_regs; // 16 is just a maximum value, query hardware for actual watchpoint count uint32_t m_max_hwp_supported = 16; -- 2.7.4