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

Backport-of: 33fd6ae98638d2a4b33d18cc4acee4f0daaa9b35
  • Loading branch information
MBaesken committed Aug 6, 2024
1 parent 4989165 commit dac39de
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 @@ -97,7 +97,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

1 comment on commit dac39de

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.