RFR: 8346785: Potential infinite loop in JavadocTokenizer.ensures

Nizar Benalla nbenalla at openjdk.org
Mon Apr 14 12:53:26 UTC 2025


Please review this patch to fix a potential infinite loop in `JavadocTokenizer.ensure` when `map.length` and `size + need` approach Interger.MAX_VALUE.

While I couldn't reproduce the issue even with large inputs (~1.9GB java file where almost the entire file is one javadoc comment), the fix is about correctness and prevention of UB in extreme cases.

TIA

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

Commit messages:
 - fix JdT.ensure

Changes: https://git.openjdk.org/jdk/pull/24620/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24620&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8346785
  Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/24620.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24620/head:pull/24620

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


More information about the compiler-dev mailing list