This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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: Intepreter method & field signature verification


defineclass.cc was calling the wrong functions in some places to verify method and field signatures. _Jv_VerifyMethodSignature and _Jv_VerifyFieldSignature do not throw, they just return a boolean value. verify_method_signature and verify_field_signature should be used so that an exception gets thrown on invalid signatures.

I'm checking this in.

Bryce.

2004-05-05  Bryce McKinlay  <mckinlay@redhat.com>

	* defineclass.cc (_Jv_ClassReader::prepare_pool_entry): Use 
	verify_field_signature and verify_method_signature, not 
	_Jv_VerifyFieldSignature and _Jv_VerifyMethodSigntature.
	(_Jv_ClassReader::handleField): Likewise.
	(_Jv_ClassReader::handleMethod): Likewise.

Index: defineclass.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/defineclass.cc,v
retrieving revision 1.36
diff -u -r1.36 defineclass.cc
--- defineclass.cc	20 Apr 2004 01:38:44 -0000	1.36
+++ defineclass.cc	6 May 2004 01:02:32 -0000
@@ -776,9 +776,9 @@
 			   name_index, type_index);
 
 	  if (this_tag == JV_CONSTANT_Fieldref)
-	    _Jv_VerifyFieldSignature (pool_data[type_index].utf8);
+	    verify_field_signature (pool_data[type_index].utf8);
 	  else
-	    _Jv_VerifyMethodSignature (pool_data[type_index].utf8);
+	    verify_method_signature (pool_data[type_index].utf8);
 
 	  _Jv_Utf8Const* name = pool_data[name_index].utf8;
 
@@ -1107,7 +1107,7 @@
     }
 
   if (verify)
-    _Jv_VerifyFieldSignature (sig);
+    verify_field_signature (sig);
 
   // field->type is really a jclass, but while it is still
   // unresolved we keep an _Jv_Utf8Const* instead.
@@ -1244,7 +1244,7 @@
       else
 	verify_identifier (method->name);
 
-      _Jv_VerifyMethodSignature (method->signature);
+      verify_method_signature (method->signature);
 
       for (int i = 0; i < mth_index; ++i)
 	{

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