Skip to content

Commit

Permalink
8333622: ubsan: relocInfo_x86.cpp:101:56: runtime error: pointer inde…
Browse files Browse the repository at this point in the history
…x expression with base (-1) overflowed

Reviewed-by: thartmann, chagedorn
  • Loading branch information
Vladimir Kozlov committed Jun 6, 2024
1 parent 8de5d20 commit 33fd6ae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/hotspot/cpu/x86/relocInfo_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ address Relocation::pd_call_destination(address orig_addr) {
if (ni->is_call()) {
return nativeCall_at(addr())->destination() + adj;
} else if (ni->is_jump()) {
return nativeJump_at(addr())->jump_destination() + adj;
address dest = nativeJump_at(addr())->jump_destination();
if (dest == (address) -1) {
return addr(); // jump to self
}
return dest + adj;
} else if (ni->is_cond_jump()) {
return nativeGeneralJump_at(addr())->jump_destination() + adj;
} else if (ni->is_mov_literal64()) {
Expand Down

3 comments on commit 33fd6ae

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MBaesken
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 33fd6ae Aug 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MBaesken the backport was successfully created on the branch backport-MBaesken-33fd6ae9-master in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 33fd6ae9 from the openjdk/jdk repository.

The commit being backported was authored by Vladimir Kozlov on 6 Jun 2024 and was reviewed by Tobias Hartmann and Christian Hagedorn.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-MBaesken-33fd6ae9-master:backport-MBaesken-33fd6ae9-master
$ git checkout backport-MBaesken-33fd6ae9-master
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-MBaesken-33fd6ae9-master

Please sign in to comment.