# HG changeset patch # User rasbold # Date 1207606516 25200 # Node ID c9314fa4f757c9abc84119a9f0dac9defe9a2a3d # Parent a7d0f95410bd318d69f1529c25dc9db3f54d26e5 6663908: NegativeArraySizeException is not thrown Summary: Don't optimize zero length array allocations at compile time. Reviewed-by: kvn, never diff -r a7d0f95410bd -r c9314fa4f757 src/share/vm/opto/parse3.cpp --- a/src/share/vm/opto/parse3.cpp Thu Apr 03 21:26:03 2008 -0700 +++ b/src/share/vm/opto/parse3.cpp Mon Apr 07 15:15:16 2008 -0700 @@ -408,7 +408,7 @@ jint dim_con = find_int_con(length[j], -1); expand_fanout *= dim_con; expand_count += expand_fanout; // count the level-J sub-arrays - if (dim_con < 0 + if (dim_con <= 0 || dim_con > expand_limit || expand_count > expand_limit) { expand_count = 0;