Mercurial > hg > truffle
diff src/share/vm/prims/unsafe.cpp @ 6976:8aaef2cee3b2
Merge
author | minqi |
---|---|
date | Thu, 08 Nov 2012 16:48:01 -0800 |
parents | e81a8af10cd9 |
children | 070d523b96a7 |
line wrap: on
line diff
--- a/src/share/vm/prims/unsafe.cpp Wed Oct 31 16:20:03 2012 -0700 +++ b/src/share/vm/prims/unsafe.cpp Thu Nov 08 16:48:01 2012 -0800 @@ -124,6 +124,8 @@ assert((void*)p->obj_field_addr<oop>((jint)byte_offset) == ptr_plus_disp, "raw [ptr+disp] must be consistent with oop::field_base"); } + jlong p_size = HeapWordSize * (jlong)(p->size()); + assert(byte_offset < p_size, err_msg("Unsafe access: offset " INT64_FORMAT " > object's size " INT64_FORMAT, byte_offset, p_size)); } #endif if (sizeof(char*) == sizeof(jint)) // (this constant folds!)