Integrated: 8314275: Incorrect stepping in switch

Aggelos Biboudis abimpoudis at openjdk.org
Fri Feb 9 08:55:08 UTC 2024


On Thu, 8 Feb 2024 14:29:50 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:

> In code like the one below, the observable effect was that if the user debugs the following method, `multiply` called with `1`, the debugger steps from line 4 to line 6 (instead of 7) giving the impression that line 6 is going to be executed. The reason is that the `LineNumberTable` did not include an entry at the end of the `switch` mapping the statement that follows, to bytecode.
> 
> 
> 1 private static double multiply(Integer i) { 
> 2   double cr = 15;                              
> 3    cr = switch (i) {                            
> 4        case 1 -> cr * 1;                       
> 5        case 2 -> cr * 2;                      
> 6        default -> cr * 4;                     
> 7    };                                           
> 8    return cr;                              
> 9 }

This pull request has now been integrated.

Changeset: e3dc6a7a
Author:    Aggelos Biboudis <abimpoudis at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/e3dc6a7a28c4f049eb234c5487fca6c54298aa31
Stats:     84 lines in 2 files changed: 84 ins; 0 del; 0 mod

8314275: Incorrect stepping in switch

Reviewed-by: vromero

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

PR: https://git.openjdk.org/jdk/pull/17772


More information about the compiler-dev mailing list