Skip to content

Commit 33fd6ae

Browse files
author
Vladimir Kozlov
committedJun 6, 2024
8333622: ubsan: relocInfo_x86.cpp:101:56: runtime error: pointer index expression with base (-1) overflowed
Reviewed-by: thartmann, chagedorn
1 parent 8de5d20 commit 33fd6ae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/hotspot/cpu/x86/relocInfo_x86.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ address Relocation::pd_call_destination(address orig_addr) {
9898
if (ni->is_call()) {
9999
return nativeCall_at(addr())->destination() + adj;
100100
} else if (ni->is_jump()) {
101-
return nativeJump_at(addr())->jump_destination() + adj;
101+
address dest = nativeJump_at(addr())->jump_destination();
102+
if (dest == (address) -1) {
103+
return addr(); // jump to self
104+
}
105+
return dest + adj;
102106
} else if (ni->is_cond_jump()) {
103107
return nativeGeneralJump_at(addr())->jump_destination() + adj;
104108
} else if (ni->is_mov_literal64()) {

0 commit comments

Comments
 (0)