Integrated: 8271928: ErroneousTree with start position -1

Jan Lahoda jlahoda at openjdk.java.net
Wed Aug 11 08:57:31 UTC 2021


On Thu, 5 Aug 2021 11:30:50 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> For some (very) erroneous code, the javac's parser may create an `ErroneousTree`, which contains an empty `ModifiersTree`. The empty `ModifiersTree` will not have the position, set but the `ModifiersTree`'s position will be used as the start position of the `ErroneousTree`, leading to start position `-1`. The proposal is to fall back on the the `ErroneousTree`'s `pos` when the nested tree does not have any position set.

This pull request has now been integrated.

Changeset: 3215dbc8
Author:    Jan Lahoda <jlahoda at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/3215dbc8b8e5f2c1454741dc7f94b0232c5d911f
Stats:     33 lines in 2 files changed: 30 ins; 0 del; 3 mod

8271928: ErroneousTree with start position -1

Reviewed-by: jlaskey, vromero

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

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


More information about the compiler-dev mailing list