verify.cc (_Jv_BytecodeVerifier::branch_prepass): Use java_opcode as type for switch.
authorTom Tromey <tromey@redhat.com>
Sun, 25 Nov 2001 19:48:19 +0000 (19:48 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Sun, 25 Nov 2001 19:48:19 +0000 (19:48 +0000)
* 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.

From-SVN: r47330

libjava/ChangeLog
libjava/include/java-insns.h
libjava/verify.cc

index 2a6cd622d293b01bfb0317473c4f232fe2aa8fe1..5a542c393e04300244c1c40ed2e0700bd3a8f6a7 100644 (file)
@@ -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:
index 975a7c906c5523d521dee46cab44a0abe5a409d6..327fcd373b0ff37407f184e56de6e42f7ed34e2e 100644 (file)
@@ -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,
index 7226a93ca12940aafd16f073f6c0f4ff7d9a0d81..3b042e9963f1e64c4ef7068f3afe4fc13d353f28 100644 (file)
@@ -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)