RFR: 8366196: Crash in AbstractMethodCheck.getMethodCheckFailure
Jan Lahoda
jlahoda at openjdk.org
Thu Oct 30 16:56:04 UTC 2025
`AttrRecover` invokes `Attr.checkMethod` with a cached `CheckContext`. `checkMethod` may be calling `report` on the `CheckContext`:
https://github.com/openjdk/jdk/blob/ed36b9bb6f3d429db6accfb3b096e50e7f2217ff/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java#L4986
This fails if the cached `CheckContext` is a `MethodCheckContext`, whose `report` method throws.
The proposal herein is to not delegate to the cached `CheckContext`'s `report` method, but rather always report the error using `Check.basicHandler`.
-------------
Commit messages:
- 8366196: Crash in AbstractMethodCheck.getMethodCheckFailure
Changes: https://git.openjdk.org/jdk/pull/28066/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28066&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8366196
Stats: 66 lines in 2 files changed: 64 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/28066.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28066/head:pull/28066
PR: https://git.openjdk.org/jdk/pull/28066
More information about the compiler-dev
mailing list