This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: Even more verifier fixes
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 18 Nov 2001 18:29:07 -0700
- Subject: Patch: FYI: Even more verifier fixes
- Reply-to: tromey at redhat dot com
I'm checking this in.
With this patch the Mauve test harness verifies.
This patch fixes a thinko regarding sign-extension in the get_*
methods.
It also fixes check_return_type, which was checking for type
compatibility incorrectly.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* verify.cc (_Jv_BytecodeVerifier::get_ushort): Use `jint' for
temporary values.
(_Jv_BytecodeVerifier::get_short): Likewise.
(_Jv_BytecodeVerifier::get_int): Likewise.
(_Jv_BytecodeVerifier::check_return_type): Reverse ordering of
`compatible' call.
Index: verify.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/verify.cc,v
retrieving revision 1.9
diff -u -r1.9 verify.cc
--- verify.cc 2001/11/19 00:31:37 1.9
+++ verify.cc 2001/11/19 01:02:48
@@ -946,25 +946,25 @@
jint get_ushort ()
{
- jbyte b1 = get_byte ();
- jbyte b2 = get_byte ();
+ jint b1 = get_byte ();
+ jint b2 = get_byte ();
return (jint) ((b1 << 8) | b2) & 0xffff;
}
jint get_short ()
{
- jbyte b1 = get_byte ();
- jbyte b2 = get_byte ();
+ jint b1 = get_byte ();
+ jint b2 = get_byte ();
jshort s = (b1 << 8) | b2;
return (jint) s;
}
jint get_int ()
{
- jbyte b1 = get_byte ();
- jbyte b2 = get_byte ();
- jbyte b3 = get_byte ();
- jbyte b4 = get_byte ();
+ jint b1 = get_byte ();
+ jint b2 = get_byte ();
+ jint b3 = get_byte ();
+ jint b4 = get_byte ();
return (b1 << 24) | (b2 << 16) | (b3 << 8) | b4;
}
@@ -1644,10 +1644,10 @@
return get_one_type (p);
}
- void check_return_type (type expected)
+ void check_return_type (type onstack)
{
type rt = compute_return_type (current_method->self->signature);
- if (! expected.compatible (rt))
+ if (! rt.compatible (onstack))
verify_fail ("incompatible return type", start_PC);
}