Author: Nikita Popov Date: 2022-10-18T15:11:21+02:00 New Revision: 6f59f302e4358b4dc869bc298c2b9c06aa716b60
URL: https://github.com/llvm/llvm-project/commit/6f59f302e4358b4dc869bc298c2b9c06aa716b60 DIFF: https://github.com/llvm/llvm-project/commit/6f59f302e4358b4dc869bc298c2b9c06aa716b60.diff LOG: [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 Added: Modified: lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h Removed: ################################################################################ diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h index fac395807796c..942c65fcd241d 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h @@ -122,7 +122,7 @@ class NativeRegisterContextLinux_ppc64le : public NativeRegisterContextLinux { int mode; // Defines if watchpoint is read/write/access. }; - std::array<DREG, 4> m_hwp_regs; + std::array<DREG, 16> m_hwp_regs; // 16 is just a maximum value, query hardware for actual watchpoint count uint32_t m_max_hwp_supported = 16; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits