8022508: javac crashes if the generics arity of a base class is wrong
authorjlahoda
Thu, 15 Aug 2013 22:36:08 +0200
changeset 19503 58688e470d3b
parent 19502 f30b3ef165ea
child 19504 d3cc5896ec3c
8022508: javac crashes if the generics arity of a base class is wrong Reviewed-by: mcimadamore, vromero
langtools/src/share/classes/com/sun/tools/javac/comp/Check.java
langtools/test/tools/javac/generics/8016640/T8016640.java
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Aug 15 22:33:43 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Aug 15 22:36:08 2013 +0200
@@ -1747,7 +1747,7 @@
         if (!sup.hasTag(CLASS)) return;
 
         for (Type t1 = sup;
-             t1.tsym.type.isParameterized();
+             t1.hasTag(CLASS) && t1.tsym.type.isParameterized();
              t1 = types.supertype(t1)) {
             for (Scope.Entry e1 = t1.tsym.members().elems;
                  e1 != null;
--- a/langtools/test/tools/javac/generics/8016640/T8016640.java	Thu Aug 15 22:33:43 2013 +0200
+++ b/langtools/test/tools/javac/generics/8016640/T8016640.java	Thu Aug 15 22:36:08 2013 +0200
@@ -1,10 +1,11 @@
 /*
  * @test /nodynamiccopyright/
- * @bug     8016640
+ * @bug     8016640 8022508
  * @summary compiler hangs if the generics arity of a base class is wrong
  * @compile/fail/ref=T8016640.out -XDrawDiagnostics T8016640.java
  */
 class T8016640 {
     static class Foo<X,Y> { }
     static class BadFoo<T> extends Foo<T> { }
+    static class SubBadFoo<T> extends BadFoo<T> { }
 }