On Tue, 14 May 2024 13:18:51 GMT, Adam Sotona <[email protected]> wrote:
> Class file with `LineNumberTable` attribute element pointing behind the
> bytecode array throws `ArrayIndexOutOfBoundsException`.
> This patch performs the check and throws expected `IllegalArgumentException`
> instead.
> Relevant test is added.
>
> Please review.
>
> Thanks,
> Adam
src/java.base/share/classes/jdk/internal/classfile/impl/CodeImpl.java line 241:
> 239: int startPc = classReader.readU2(p);
> 240: if (startPc > codeLength) {
> 241: throw new
> IllegalArgumentException(String.format("Line number out of range;
> start_pc=%d, codeLength=%d",
It's the byte code index that is out of range, not the line number associated
with it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19230#discussion_r1600292689