RFR: 8259235: javac crashes while attributing super method invocation

Vicente Romero vromero at openjdk.java.net
Wed Feb 3 00:57:44 UTC 2021


On Tue, 5 Jan 2021 16:47:26 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> 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.

looks good

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

Marked as reviewed by vromero (Reviewer).

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


More information about the compiler-dev mailing list