expr.c (build_invokeinterface): Abort if method's context is not an interface.
authorTom Tromey <tromey@redhat.com>
Wed, 22 Jan 2003 20:53:54 +0000 (20:53 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Wed, 22 Jan 2003 20:53:54 +0000 (20:53 +0000)
* expr.c (build_invokeinterface): Abort if method's context is not
an interface.

From-SVN: r61615

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

index bdb9917d6cb73fdcf777e007ea153b7a8f7432ec..5d42c0a7dc7b7ab18dbc8b03ce908dd9446e6870 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-22  Tom Tromey  <tromey@redhat.com>
+
+       * expr.c (build_invokeinterface): Abort if method's context is not
+       an interface.
+
 2003-01-22  Tom Tromey  <tromey@redhat.com>
 
        * gcj.texi (Input and output files): Mention non-class entries.
index e5c677c2c11c314321f1e8033a07356b05991e14..bf1f41b541405176e62daef9d93b187a777135c5 100644 (file)
@@ -1901,15 +1901,16 @@ build_invokeinterface (tree dtable, tree method)
      abstract nor static.  */
            
   if (class_ident == NULL_TREE)
-    {
-      class_ident = get_identifier ("class");
-    }
+    class_ident = get_identifier ("class");
 
-  dtable = build_java_indirect_ref (dtable_type, dtable, flag_check_references);
+  dtable = build_java_indirect_ref (dtable_type, dtable,
+                                   flag_check_references);
   dtable = build (COMPONENT_REF, class_ptr_type, dtable,
                  lookup_field (&dtable_type, class_ident));
 
   interface = DECL_CONTEXT (method);
+  if (! CLASS_INTERFACE (TYPE_NAME (interface)))
+    abort ();
   layout_class_methods (interface);
   
   if (flag_indirect_dispatch)