summaryrefslogtreecommitdiff
path: root/libjava/verify.cc
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-11 01:57:05 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-11 01:57:05 +0000
commit2bcd45dce03c7e08d335e305b6501acecb45111d (patch)
treedb48dc2c7d649aaa27bf51aacd0d1e699cf33b3d /libjava/verify.cc
parent2fcde2174982878d81582ba6c73354c08d51751d (diff)
downloadgcc-2bcd45dce03c7e08d335e305b6501acecb45111d.tar.gz
* verify.cc (pop64): Removed.
(verify_instructions_0) <op_pop2>: Inline code. Don't throw exception if top-of-stack is narrow. (initialize_stack): Check to ensure that <init> is not static and <clinit> is. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65453 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/verify.cc')
-rw-r--r--libjava/verify.cc28
1 files changed, 17 insertions, 11 deletions
diff --git a/libjava/verify.cc b/libjava/verify.cc
index 8f8c1df9eb1..4a6ca458849 100644
--- a/libjava/verify.cc
+++ b/libjava/verify.cc
@@ -1202,14 +1202,6 @@ private:
return r;
}
- type pop64 ()
- {
- type r = pop_raw ();
- if (! r.iswide ())
- verify_fail ("wide pop of narrow type");
- return r;
- }
-
type pop_type (type match)
{
match.promote ();
@@ -2160,21 +2152,31 @@ private:
bool initialize_stack ()
{
int var = 0;
- bool is_init = false;
+ bool is_init = _Jv_equalUtf8Consts (current_method->self->name,
+ gcj::init_name);
+ bool is_clinit = _Jv_equalUtf8Consts (current_method->self->name,
+ gcj::clinit_name);
using namespace java::lang::reflect;
if (! Modifier::isStatic (current_method->self->accflags))
{
type kurr (current_class);
- if (_Jv_equalUtf8Consts (current_method->self->name, gcj::init_name))
+ if (is_init)
{
kurr.set_uninitialized (type::SELF, this);
is_init = true;
}
+ else if (is_clinit)
+ verify_fail ("<clinit> method must be static");
set_variable (0, kurr);
current_state->set_this_type (kurr);
++var;
}
+ else
+ {
+ if (is_init)
+ verify_fail ("<init> method must be non-static");
+ }
// We have to handle wide arguments specially here.
int arg_count = _Jv_count_arguments (current_method->self->signature);
@@ -2525,7 +2527,11 @@ private:
pop32 ();
break;
case op_pop2:
- pop64 ();
+ {
+ type t = pop_raw ();
+ if (! t.iswide ())
+ pop32 ();
+ }
break;
case op_dup:
{