diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-11-25 19:48:19 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-11-25 19:48:19 +0000 |
commit | 0a19fb320a742b889d5fa4d0ef286f37d0295e6e (patch) | |
tree | 6ed6f524467095e251948101498c4efe08108408 | |
parent | 9ddb1887d23392440e1c9817e429499bed8dbd8a (diff) | |
download | gcc-0a19fb320a742b889d5fa4d0ef286f37d0295e6e.tar.gz |
* verify.cc (_Jv_BytecodeVerifier::branch_prepass): Use
java_opcode as type for switch.
[op_wide]: Likewise.
(_Jv_BytecodeVerifier::verify_instructions_0): Likewise.
[op_invokevirtual]: Likewise.
* include/java-insns.h (java_opcode): Give enum a name.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47330 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libjava/ChangeLog | 9 | ||||
-rw-r--r-- | libjava/include/java-insns.h | 4 | ||||
-rw-r--r-- | libjava/verify.cc | 16 |
3 files changed, 19 insertions, 10 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 2a6cd622d29..5a542c393e0 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,12 @@ +2001-11-22 Tom Tromey <tromey@redhat.com> + + * verify.cc (_Jv_BytecodeVerifier::branch_prepass): Use + java_opcode as type for switch. + [op_wide]: Likewise. + (_Jv_BytecodeVerifier::verify_instructions_0): Likewise. + [op_invokevirtual]: Likewise. + * include/java-insns.h (java_opcode): Give enum a name. + 2001-11-25 Tom Tromey <tromey@redhat.com> Fix for PR libgcj/4583: diff --git a/libjava/include/java-insns.h b/libjava/include/java-insns.h index 975a7c906c5..327fcd373b0 100644 --- a/libjava/include/java-insns.h +++ b/libjava/include/java-insns.h @@ -1,6 +1,6 @@ // java-insns.h - Instruction encodings. This is -*- c++ -*- -/* Copyright (C) 1999 Free Software Foundation +/* Copyright (C) 1999, 2001 Free Software Foundation This file is part of libgcj. @@ -11,7 +11,7 @@ details. */ #ifndef __JAVA_INSNS_H__ #define __JAVA_INSNS_H__ -enum +enum java_opcode { op_nop = 0x00, op_aconst_null = 0x01, diff --git a/libjava/verify.cc b/libjava/verify.cc index 7226a93ca12..3b042e9963f 100644 --- a/libjava/verify.cc +++ b/libjava/verify.cc @@ -1221,7 +1221,7 @@ private: last_was_jsr = false; start_PC = PC; - unsigned char opcode = bytecode[PC++]; + java_opcode opcode = (java_opcode) bytecode[PC++]; switch (opcode) { case op_nop: @@ -1472,9 +1472,9 @@ private: case op_wide: { - opcode = get_byte (); + opcode = (java_opcode) get_byte (); get_short (); - if (opcode == (unsigned char) op_iinc) + if (opcode == op_iinc) get_short (); } break; @@ -1777,7 +1777,7 @@ private: } start_PC = PC; - unsigned char opcode = bytecode[PC++]; + java_opcode opcode = (java_opcode) bytecode[PC++]; switch (opcode) { case op_nop: @@ -2377,11 +2377,11 @@ private: _Jv_Utf8Const *method_name, *method_signature; type class_type = check_method_constant (get_ushort (), - opcode == (unsigned char) op_invokeinterface, + opcode == op_invokeinterface, &method_name, &method_signature); int arg_count = _Jv_count_arguments (method_signature); - if (opcode == (unsigned char) op_invokeinterface) + if (opcode == op_invokeinterface) { int nargs = get_byte (); if (nargs == 0) @@ -2399,7 +2399,7 @@ private: if (_Jv_equalUtf8Consts (method_name, gcj::init_name)) { is_init = true; - if (opcode != (unsigned char) op_invokespecial) + if (opcode != op_invokespecial) verify_fail ("can't invoke <init>", start_PC); } else if (method_name->data[0] == '<') @@ -2412,7 +2412,7 @@ private: for (int i = arg_count - 1; i >= 0; --i) pop_type (arg_types[i]); - if (opcode != (unsigned char) op_invokestatic) + if (opcode != op_invokestatic) { type t = class_type; if (is_init) |