changeset 49661:a3fed4b041ac

8199780: SetMemory0 and CopyMemory0 in unsafe.cpp need to resolve their operands Reviewed-by: shade, zgu, eosterlund
author rkennke
date Tue, 03 Apr 2018 17:36:19 +0200
parents 89a886b7a9cf
children 3614cbddd005
files src/hotspot/share/prims/unsafe.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 {