8199780: SetMemory0 and CopyMemory0 in unsafe.cpp need to resolve their operands
authorrkennke
Tue, 03 Apr 2018 17:36:19 +0200
changeset 49661 a3fed4b041ac
parent 49660 89a886b7a9cf
child 49662 3614cbddd005
8199780: SetMemory0 and CopyMemory0 in unsafe.cpp need to resolve their operands Reviewed-by: shade, zgu, eosterlund
src/hotspot/share/prims/unsafe.cpp
--- a/src/hotspot/share/prims/unsafe.cpp	Tue Apr 03 12:55:26 2018 +0200
+++ b/src/hotspot/share/prims/unsafe.cpp	Tue Apr 03 17:36:19 2018 +0200
@@ -123,6 +123,10 @@
   assert_field_offset_sane(p, field_offset);
   jlong byte_offset = field_offset_to_byte_offset(field_offset);
 
+  if (p != NULL) {
+    p = Access<>::resolve(p);
+  }
+
   if (sizeof(char*) == sizeof(jint)) {   // (this constant folds!)
     return (address)p + (jint) byte_offset;
   } else {