src/share/vm/opto/macroArrayCopy.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/opto/macroArrayCopy.cpp

src/share/vm/opto/macroArrayCopy.cpp

Print this page
rev 6950 : 8055910: closed/java/util/Collections/CheckedCollections.java failed with ClassCastException not thrown
Summary: missing subtype check for Arrays.copyOf intrinsic
Reviewed-by:

*** 504,513 **** --- 504,515 ---- // Get the klass* for both src and dest Node* src_klass = ac->in(ArrayCopyNode::SrcKlass); Node* dest_klass = ac->in(ArrayCopyNode::DestKlass); + assert(src_klass != NULL && dest_klass != NULL, "should have klasses"); + // Generate the subtype check. // This might fold up statically, or then again it might not. // // Non-static example: Copying List<String>.elements to a new String[]. // The backing store for a List<String> is always an Object[],
*** 1207,1223 **** --- 1209,1227 ---- // (6) length must not be negative (moved to generate_arraycopy()). // generate_negative_guard(length, slow_region); // (7) src_offset + length must not exceed length of src. Node* alen = ac->in(ArrayCopyNode::SrcLen); + assert(alen != NULL, "need src len"); generate_limit_guard(&ctrl, src_offset, length, alen, slow_region); // (8) dest_offset + length must not exceed length of dest. alen = ac->in(ArrayCopyNode::DestLen); + assert(alen != NULL, "need dest len"); generate_limit_guard(&ctrl, dest_offset, length, alen, slow_region);
src/share/vm/opto/macroArrayCopy.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File