RFR: 8271928: ErroneousTree with start position -1

Jan Lahoda jlahoda at openjdk.java.net
Thu Aug 5 11:37:45 UTC 2021


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.

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

Commit messages:
 - 8271928: ErroneousTree with start position -1

Changes: https://git.openjdk.java.net/jdk/pull/5018/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5018&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8271928
  Stats: 33 lines in 2 files changed: 30 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5018.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5018/head:pull/5018

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


More information about the compiler-dev mailing list