+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:
// 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.
#ifndef __JAVA_INSNS_H__
#define __JAVA_INSNS_H__
-enum
+enum java_opcode
{
op_nop = 0x00,
op_aconst_null = 0x01,
last_was_jsr = false;
start_PC = PC;
- unsigned char opcode = bytecode[PC++];
+ java_opcode opcode = (java_opcode) bytecode[PC++];
switch (opcode)
{
case op_nop:
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;
}
start_PC = PC;
- unsigned char opcode = bytecode[PC++];
+ java_opcode opcode = (java_opcode) bytecode[PC++];
switch (opcode)
{
case op_nop:
_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)
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] == '<')
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)