mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8203881: Print erroneous size in NegativeArraySizeException
Reviewed-by: dholmes, stuefe
This commit is contained in:
parent
6a48db9cf6
commit
ff2c3d4dbe
6 changed files with 315 additions and 7 deletions
|
@ -975,7 +975,9 @@ bool InstanceKlass::is_same_or_direct_interface(Klass *k) const {
|
|||
}
|
||||
|
||||
objArrayOop InstanceKlass::allocate_objArray(int n, int length, TRAPS) {
|
||||
if (length < 0) THROW_0(vmSymbols::java_lang_NegativeArraySizeException());
|
||||
if (length < 0) {
|
||||
THROW_MSG_0(vmSymbols::java_lang_NegativeArraySizeException(), err_msg("%d", length));
|
||||
}
|
||||
if (length > arrayOopDesc::max_array_length(T_OBJECT)) {
|
||||
report_java_out_of_memory("Requested array size exceeds VM limit");
|
||||
JvmtiExport::post_array_size_exhausted();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue