RFR: 8350201: Out of bounds access on Linux aarch64 in os::print_register_info

Andrew Haley aph at openjdk.org
Tue Feb 18 08:58:09 UTC 2025


On Tue, 18 Feb 2025 06:49:31 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> aarch64.ad has a comment that probably ought to be fixed: https://github.com/openjdk/jdk/blame/8df804005ed772936fd77a4c0335a5620f909570/src/hotspot/cpu/aarch64/aarch64.ad#L71
> 
> It also has SP as R31, but I guess that's okay.
> 
> Over in register_aarch64.hpp we have `number_of_registers = 32`, including r31_sp. And `zr` and `sp` are 32 and 33, respectively. So that all seems a little bit confusing. But it all seems to work...

It is confusing, but that's how it works. Some instructions treat r31 as ZR, some as SP. ZR (obviously?) does not need saving or printing.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/23667#issuecomment-2664984341


More information about the hotspot-runtime-dev mailing list