< prev index next >

src/share/vm/prims/unsafe.cpp

Print this page

        

*** 124,134 **** void* ptr_plus_disp = (address)p + byte_offset; 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!) return (address)p + (jint) byte_offset; else --- 124,134 ---- void* ptr_plus_disp = (address)p + byte_offset; 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, "Unsafe access: offset " INT64_FORMAT " > object's size " INT64_FORMAT, byte_offset, p_size); } #endif if (sizeof(char*) == sizeof(jint)) // (this constant folds!) return (address)p + (jint) byte_offset; else
< prev index next >