summaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-20 00:38:40 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-20 00:38:40 +0000
commita17ecab45dd654b81ca5c252c12b2179df6ea435 (patch)
tree31dffbc4c9cad6ccd8dbf2c7dff459fb06d16429 /libjava
parented9410fbd9797ed6a7e0535972490532a0fa8644 (diff)
downloadgcc-a17ecab45dd654b81ca5c252c12b2179df6ea435.tar.gz
* verify.cc (_Jv_BytecodeVerifier::require_array_type): Special
case for boolean arrays. * verify.cc (_Jv_BytecodeVerifier::compute_jump): Put PC into error message. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47190 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/verify.cc16
2 files changed, 19 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 99a69b8b707..01b089abc64 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,11 @@
2001-11-19 Tom Tromey <tromey@redhat.com>
+ * verify.cc (_Jv_BytecodeVerifier::require_array_type): Special
+ case for boolean arrays.
+
+ * verify.cc (_Jv_BytecodeVerifier::compute_jump): Put PC into
+ error message.
+
* verify.cc (_Jv_BytecodeVerifier::verify_instructions_0)
[op_lshl, op_lshr, op_lushr]: Shift argument is an int, not a
long.
diff --git a/libjava/verify.cc b/libjava/verify.cc
index 2562d1af25e..b9571c4b870 100644
--- a/libjava/verify.cc
+++ b/libjava/verify.cc
@@ -28,7 +28,6 @@ details. */
// TO DO
// * read more about when classes must be loaded
-// * there are bugs with boolean arrays?
// * class loader madness
// * Lots and lots of debugging and testing
// * type representation is still ugly. look for the big switches
@@ -951,7 +950,18 @@ private:
type t = array.element_type ();
if (! element.compatible (t))
- verify_fail ("incompatible array element type");
+ {
+ // Special case for byte arrays, which must also be boolean
+ // arrays.
+ bool ok = true;
+ if (element.key == byte_type)
+ {
+ type e2 (boolean_type);
+ ok = e2.compatible (t);
+ }
+ if (! ok)
+ verify_fail ("incompatible array element type");
+ }
// Return T and not ELEMENT, because T might be specialized.
return t;
@@ -992,7 +1002,7 @@ private:
{
int npc = start_PC + offset;
if (npc < 0 || npc >= current_method->code_length)
- verify_fail ("branch out of range");
+ verify_fail ("branch out of range", start_PC);
return npc;
}