This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Java [ABI]: Verifier patch #2


This patch re-enables the old verifier that was accidientally broken in my first patch, and works around a few warnings that are causing "make bootstrap" to fail.

Bryce


2004-10-06  Bryce McKinlay  <mckinlay@redhat.com>

        * Make-lang.in (verify.o): Re-enabled this target.
        * verify-glue.c (vfy_get_interface_count): Add ATTRIBUTE_UNUSED.
        (vfy_get_interface): Likewise.
        (verify_jvm_instructions_new): Renamed from verify_jvm_instructions.
        * verify.h (verify_jvm_instructions_new): Declare.        
        * verify-impl.c (free_state): Temporarily comment out unused
        function.

Index: Make-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Make-lang.in,v
retrieving revision 1.136.4.2
diff -u -r1.136.4.2 Make-lang.in
--- Make-lang.in	6 Oct 2004 02:59:11 -0000	1.136.4.2
+++ Make-lang.in	6 Oct 2004 23:23:21 -0000
@@ -101,7 +101,7 @@
 
 # Executables built by this Makefile:
 JAVA_OBJS = java/parse.o java/class.o java/decl.o java/expr.o \
-  java/constants.o java/lang.o java/typeck.o java/except.o \
+  java/constants.o java/lang.o java/typeck.o java/except.o java/verify.o \
   java/verify-glue.o java/verify-impl.o \
   java/zextract.o java/jcf-io.o java/win32-host.o java/jcf-parse.o java/mangle.o \
   java/mangle_name.o java/builtins.o java/resource.o \
@@ -327,6 +327,9 @@
 java/typeck.o: java/typeck.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
   java/convert.h toplev.h $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) real.h
 java/win32-host.o: java/win32-host.c $(CONFIG_H) $(SYSTEM_H) java/jcf.h
+java/verify.o: java/verify.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
+  java/javaop.h java/java-opcodes.h java/java-except.h toplev.h $(SYSTEM_H) \
+  coretypes.h $(TM_H)
 java/verify-glue.o: java/verify-glue.c $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) \
   coretypes.h $(TM_H) java/verify.h
 java/verify-impl.o: java/verify-impl.c $(CONFIG_H) java/verify.h $(SYSTEM_H) \
Index: verify-glue.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/verify-glue.c,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 verify-glue.c
--- verify-glue.c	6 Oct 2004 02:59:10 -0000	1.1.2.1
+++ verify-glue.c	6 Oct 2004 23:23:22 -0000
@@ -230,7 +230,7 @@
 }
 
 int
-vfy_get_interface_count (vfy_jclass klass)
+vfy_get_interface_count (vfy_jclass klass ATTRIBUTE_UNUSED)
 {
   /* FIXME: Need to merge from mainline to get this. */
   #if 0
@@ -240,14 +240,15 @@
 }
 
 vfy_jclass
-vfy_get_interface (vfy_jclass klass, int index)
+vfy_get_interface (vfy_jclass klass ATTRIBUTE_UNUSED, int index ATTRIBUTE_UNUSED)
 {
   /* FIXME: Need to merge from mainline to get this. */
-  vfy_jclass k;
   #if 0
+  vfy_jclass k;
   k = BINFO_BASE_BINFO (klass, index);
-  #endif
   return k;
+  #endif
+  return NULL;
 }
 
 bool
@@ -378,7 +379,7 @@
 /* Verify the bytecodes of the current method.
    Return 1 on success, 0 on failure. */
 int
-verify_jvm_instructions (JCF *jcf, const unsigned char *byte_ops,
+verify_jvm_instructions_new (JCF *jcf, const unsigned char *byte_ops,
 			 long length)
 {
   vfy_method method;
Index: verify.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/verify.h,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 verify.h
--- verify.h	6 Oct 2004 17:34:15 -0000	1.1.2.1
+++ verify.h	6 Oct 2004 23:23:22 -0000
@@ -73,6 +73,10 @@
   int exc_count;
 } vfy_method;
 
+/* Entry point to the verifier.  */
+int verify_jvm_instructions_new (JCF *jcf, const unsigned char *byte_ops,
+				 long length);
+
 void *vfy_alloc (size_t bytes);
 void vfy_free (void *mem);
 bool vfy_strings_equal (vfy_string one, vfy_string two);
Index: verify-impl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/verify-impl.c,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 verify-impl.c
--- verify-impl.c	6 Oct 2004 02:59:10 -0000	1.1.2.1
+++ verify-impl.c	6 Oct 2004 23:23:22 -0000
@@ -511,6 +511,7 @@
       break;
     default:
       verify_fail ("invalid signature");
+      return null_type;
     }
   return rt;
 }
@@ -1088,6 +1089,7 @@
   return s;
 }
 
+#if 0
 static void
 free_state (state *s)
 {
@@ -1096,6 +1098,7 @@
   if (s->locals != NULL)
     vfy_free (s->locals);
 }
+#endif
 
 #if 0
     void *operator new[] (size_t bytes)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]