Integrated: 8264561: javap get NegativeArraySizeException on bad instruction

Adam Sotona asotona at openjdk.java.net
Mon May 17 15:27:39 UTC 2021


On Mon, 17 May 2021 13:11:56 GMT, Adam Sotona <asotona at openjdk.org> wrote:

> Actual javap implementation reacts on corrupted TABLESWITCH or LOOKUPSWITCH bytecode instructions resulting to negative array allocation with NegativeArraySizeException, which is reported to user with stack trace and as serious internal error.
> 
> The fix in c.s.t.classfile.Instruction is checking for negative array size of corrupted TABLESWITCH or LOOKUPSWITCH bytecode and throwing j.l.IllegalStateException instead of the NegativeArraySizeException.
>  
> Another part of the fix in c.s.t.javap.CodeWriter is catching j.l.IllegalStateException and reporting it as error in the analyzed bytecode, instead of passing it up and causing serious internal javap error.

This pull request has now been integrated.

Changeset: cf97252f
Author:    Adam Sotona <asotona at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/cf97252f3fd4e7bdb57271b92dd2866101d4a94b
Stats:     5 lines in 2 files changed: 4 ins; 0 del; 1 mod

8264561: javap get NegativeArraySizeException on bad instruction

Reviewed-by: vromero

-------------

PR: https://git.openjdk.java.net/jdk/pull/4061


More information about the core-libs-dev mailing list