On Fri, 11 Oct 2024 05:39:20 GMT, Chen Liang <li...@openjdk.org> wrote:

> Patch a tableswitch instruction's low value to be greater than a high value, 
> previously, javap will not print any previous instruction and report 
> problematic address/bci to be 0. This is because the iteration of bound 
> models require first collecting all data into a buffer list. We call the 
> eager `forEach` instead to avoid this problem.
> 
> Before:
> 
> $ javap -c BadSwitch.class
> Compiled from "BadSwitch.java"
> final class BadSwitch {
>   static void work(int);
>     Code:
> Error: error at or after byte 0
> }
> 
> 
> Now:
> 
> $ $localjdk2/bin/javap -c BadSwitch.class
> Compiled from "BadSwitch.java"
> final class BadSwitch {
>   static void work(int);
>     Code:
>        0: iload_0
> Error: error at or after address 1: Invalid tableswitch values low: 9 high: 5
> }

Marked as reviewed by abdelhak-za...@github.com (no known OpenJDK username).

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

PR Review: https://git.openjdk.org/jdk/pull/21463#pullrequestreview-2363921436

Reply via email to