expr.c (pop_type_0): Return `Object' if trying to merge two interface types.
authorTom Tromey <tromey@cygnus.com>
Tue, 12 Sep 2000 22:31:00 +0000 (22:31 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Tue, 12 Sep 2000 22:31:00 +0000 (22:31 +0000)
* expr.c (pop_type_0): Return `Object' if trying to merge two
interface types.
* verify.c (merge_types): Don't return `TYPE_UNKNOWN' for
interface types; `Object' is always a valid supertype.

From-SVN: r36378

gcc/java/ChangeLog
gcc/java/expr.c
gcc/java/verify.c

index 7b13f9a0485da645d913a943e155dd86ccac7ea2..68a1a131f3d15326640c3af01f82d5179a7e7c6f 100644 (file)
@@ -1,3 +1,10 @@
+2000-09-12  Tom Tromey  <tromey@cygnus.com>
+
+       * expr.c (pop_type_0): Return `Object' if trying to merge two
+       interface types.
+       * verify.c (merge_types): Don't return `TYPE_UNKNOWN' for
+       interface types; `Object' is always a valid supertype.
+
 2000-09-12  Tom Tromey  <tromey@cygnus.com>
 
        Fix for PR gcj/33:
index ebba1aca7fa4235f44336cb47408e377bd36a3a2..fbc08c69fa2a7a3c8b3ae7bada8d3107942d96a1 100644 (file)
@@ -320,9 +320,8 @@ pop_type_0 (type)
       /* This is a kludge, but matches what Sun's verifier does.
         It can be tricked, but is safe as long as type errors
         (i.e. interface method calls) are caught at run-time. */
-      else if (CLASS_INTERFACE (TYPE_NAME (TREE_TYPE (type)))
-              && t == object_ptr_type_node)
-       return t;
+      /* FIXME: this is worse than a kludge, probably.  */
+      return object_ptr_type_node;
     }
   return NULL_TREE;
 }
index fcaf7f37af5e204744a8aa53cd027b63eceabd6a..5bc82cfe381c14df41a26e29601eb550e7dea0d3 100644 (file)
@@ -173,6 +173,8 @@ merge_types (type1, type2)
 
       if (CLASS_INTERFACE (TYPE_NAME (tt1)))
        {
+         /* FIXME: should see if two interfaces have a common
+            superinterface.  */
          if (CLASS_INTERFACE (TYPE_NAME (tt2)))
            {
              /* This is a kludge, but matches what Sun's verifier does.
@@ -185,7 +187,7 @@ merge_types (type1, type2)
              if (can_widen_reference_to (tt2, tt1))
                return type1;
              else
-               return TYPE_UNKNOWN;
+               return object_ptr_type_node;
            }
        }
       else if (CLASS_INTERFACE (TYPE_NAME (tt2)))
@@ -193,7 +195,7 @@ merge_types (type1, type2)
          if (can_widen_reference_to (tt1, tt2))
            return type2;
          else
-           return TYPE_UNKNOWN;
+           return object_ptr_type_node;
        }
 
       type1 = tt1;