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]

Patch: FYI: BC merge cleanup in new verifier


Andrew Pinski pointed out a few bugs in the new verifier that came in
from the BC merge, which for whatever reason were never caught.

This patch fixes them.

There's still a warning in verify.h, but that does not seem as urgent
and I will fix it a bit later.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* verify-impl.c (vfy_push_type): Removed bogus "return".
	(initialize_stack): Use vfy_alloc and vfy_free.
	(verify_instructions_0): Likewise.

Index: verify-impl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/verify-impl.c,v
retrieving revision 1.2
diff -u -r1.2 verify-impl.c
--- verify-impl.c 25 Nov 2004 03:46:41 -0000 1.2
+++ verify-impl.c 25 Nov 2004 05:11:32 -0000
@@ -1329,7 +1329,7 @@
 vfy_push_type (type_val tval)
 {
   type t = make_type (tval);
-  return vfy_push_type_t (t);
+  vfy_push_type_t (t);
 }
 
 #define push_type vfy_push_type
@@ -2267,7 +2267,7 @@
   /* We have to handle wide arguments specially here.  */
   arg_count = vfy_count_arguments (vfy_get_signature (vfr->current_method));
   {
-    type arg_types[arg_count];
+    type *arg_types = (type *) vfy_alloc (arg_count * sizeof (type));
     compute_argument_types (vfy_get_signature (vfr->current_method), arg_types);
     for (i = 0; i < arg_count; ++i)
       {
@@ -2276,6 +2276,7 @@
 	if (type_iswide (&arg_types[i]))
 	  ++var;
       }
+    vfy_free (arg_types);
   }
 
   return is_init;
@@ -3037,7 +3038,7 @@
 	    arg_count = vfy_count_arguments (method_signature);
             {
 	      /* Pop arguments and check types.  */
-	      type arg_types[arg_count];
+	      type *arg_types = (type *) vfy_alloc (arg_count * sizeof (type));
 
 	      compute_argument_types (method_signature, arg_types);
 	      for (i = arg_count - 1; i >= 0; --i)
@@ -3047,6 +3048,8 @@
 		  nargs -= type_depth (&arg_types[i]);
 		  pop_init_ref_t (arg_types[i]);
 		}
+
+	      vfy_free (arg_types);
 	    }
 
 	    if (opcode == op_invokeinterface


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