RFR: 8259235: javac crashes while attributing super method invocation

Jan Lahoda jlahoda at openjdk.java.net
Tue Jan 5 16:54:04 UTC 2021


Code like:
public class SuperMethodCallBroken extends Undef implements I {
    public void test() {
        I.super.test();
    }
}
interface I {
    public default void test() {}
}

crashes javac. The reason is that when `I.super` is being attributed, the interfaces of the enclosing class are pruned to remove subtypes - but `Undef` is erroneous and is a subtype of every type. So `I` is removed from the list of interfaces to check, and javac crashes then.

The proposed fix is to ignore erroneous supertypes when looking for subtypes.

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

Commit messages:
 - 8259235: javac crashes while attributing super method invocation

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

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


More information about the compiler-dev mailing list