Skip to content

Commit

Permalink
Unsafe fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zzambers committed Jul 25, 2024
1 parent c8d52b0 commit 4f40e7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hotspot/src/share/vm/prims/unsafe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ jint Unsafe_invocation_key_to_method_slot(jint key) {

#define GET_FIELD(obj, offset, type_name, v) \
oop p = JNIHandles::resolve(obj); \
type_name v = *(type_name*)index_oop_from_field_offset_long(p, offset)
type_name v = *(volatile type_name*)index_oop_from_field_offset_long(p, offset)

#define SET_FIELD(obj, offset, type_name, x) \
oop p = JNIHandles::resolve(obj); \
*(type_name*)index_oop_from_field_offset_long(p, offset) = truncate_##type_name(x)
*(volatile type_name*)index_oop_from_field_offset_long(p, offset) = truncate_##type_name(x)

#define GET_FIELD_VOLATILE(obj, offset, type_name, v) \
oop p = JNIHandles::resolve(obj); \
Expand Down

0 comments on commit 4f40e7a

Please sign in to comment.