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: verifier bug fix


I'm checking this in.

If the bytecode referenced a field whose type was, e.g., "I", the
verifier would erroneously push reference_type and not int_type on the
stack.  This patch fixes the problem.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* verify.cc (_Jv_BytecodeVerifier::check_field_constant): Handle
	case where field has primitive type.

Index: verify.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/verify.cc,v
retrieving revision 1.6
diff -u -r1.6 verify.cc
--- verify.cc 2001/11/16 19:59:16 1.6
+++ verify.cc 2001/11/16 23:18:39
@@ -1545,7 +1545,9 @@
 				      &name, &field_type);
     if (class_type)
       *class_type = ct;
-    return type (field_type);
+    if (field_type->data[0] == '[' || field_type->data[0] == 'L')
+      return type (field_type);
+    return get_type_val_for_signature (field_type->data[0]);
   }
 
   type check_method_constant (int index, bool is_interface,


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