RFR: 8314275: Incorrect stepping in switch [v2]

Aggelos Biboudis abimpoudis at openjdk.org
Thu Feb 8 16:31:07 UTC 2024


On Thu, 8 Feb 2024 16:21:23 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> Aggelos Biboudis has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
>> 
>>  - Merge branch 'master' into fix-#8314275
>>  - 8314275: Incorrect stepping in switch
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java line 1433:
> 
>> 1431: 
>> 1432:             // Emit line position for the end of the switch
>> 1433:             code.statBegin(TreeInfo.endPos(swtch));
> 
> shouldn't this change affect already existing tests like: RuleSwitchBreaks.java in the same folder: test/langtools/tools/javac/classfiles/attributes/LineNumberTable/?

I see what you mean. Those switches do not store their value (no store bytecode is emitted). This is why they didn't fail I presume. Do you think there is a discrepancy between how we compile the code in the two tests regarding `LineNumberTable`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17772#discussion_r1483263599


More information about the compiler-dev mailing list