verify.cc (_Jv_BytecodeVerifier::branch_prepass): Use java_opcode as type for switch.

* 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
This commit is contained in:
Tom Tromey 2001-11-25 19:48:19 +00:00 committed by Tom Tromey
parent 200f4143a2
commit fa88ce26e5
3 changed files with 19 additions and 10 deletions

View 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:

View 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,

View 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)