Patch: FYI: Today's first verifier fix

Tom Tromey tromey@redhat.com
Mon Oct 8 22:12:00 GMT 2001


Another in my continuing series of verifier fixes.
This one fixes an oversight with long shift operators.
This is another bug caught by running Mauve.
We can now run a pretty sizeable chunk of it.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* verify.cc (_Jv_BytecodeVerifier::verify_instructions_0)
	[op_lshl, op_lshr, op_lushr]: Shift argument is an int, not a
	long.

Index: verify.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/verify.cc,v
retrieving revision 1.13
diff -u -r1.13 verify.cc
--- verify.cc 2001/11/19 07:08:36 1.13
+++ verify.cc 2001/11/19 18:26:20
@@ -2132,13 +2132,16 @@
 	  case op_lmul:
 	  case op_ldiv:
 	  case op_lrem:
-	  case op_lshl:
-	  case op_lshr:
-	  case op_lushr:
 	  case op_land:
 	  case op_lor:
 	  case op_lxor:
 	    pop_type (long_type);
+	    push_type (pop_type (long_type));
+	    break;
+	  case op_lshl:
+	  case op_lshr:
+	  case op_lushr:
+	    pop_type (int_type);
 	    push_type (pop_type (long_type));
 	    break;
 	  case op_fadd:



More information about the Java-patches mailing list