diff options
author | Tom Tromey <tromey@redhat.com> | 2002-01-28 00:46:23 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2002-01-28 00:46:23 +0000 |
commit | 1919a4e7e0433898e98d790d19547c808a01c329 (patch) | |
tree | 4cb93d76f4552c57f5b04dfeef22b9a5aaaefe02 /libjava | |
parent | 73068e369ffca55c491c6c519e7824eeb5011489 (diff) | |
download | gcc-1919a4e7e0433898e98d790d19547c808a01c329.zip gcc-1919a4e7e0433898e98d790d19547c808a01c329.tar.gz gcc-1919a4e7e0433898e98d790d19547c808a01c329.tar.bz2 |
verify.cc (class _Jv_BytecodeVerifier): Removed `FIXME' comment and to-do list.
* verify.cc (class _Jv_BytecodeVerifier): Removed `FIXME' comment
and to-do list.
(state::merge): Use current class' class loader.
(state::print): Print subroutine.
(state::merge): Don't look at subroutine of unmerged `ret'.
From-SVN: r49274
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 8 | ||||
-rw-r--r-- | libjava/verify.cc | 27 |
2 files changed, 22 insertions, 13 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 8090624..4d49c9c 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,11 @@ +2002-01-27 Tom Tromey <tromey@redhat.com> + + * verify.cc (class _Jv_BytecodeVerifier): Removed `FIXME' comment + and to-do list. + (state::merge): Use current class' class loader. + (state::print): Print subroutine. + (state::merge): Don't look at subroutine of unmerged `ret'. + 2002-01-26 Andreas Tobler <a.tobler@schweiz.ch> * nogc.cc: Remove warnings. diff --git a/libjava/verify.cc b/libjava/verify.cc index ac380cb..f45a276 100644 --- a/libjava/verify.cc +++ b/libjava/verify.cc @@ -31,13 +31,6 @@ details. */ #include <stdio.h> #endif /* VERIFY_DEBUG */ -// TO DO -// * read more about when classes must be loaded -// * class loader madness -// * Lots and lots of debugging and testing -// * type representation is still ugly. look for the big switches -// * at least one GC problem :-( - static void debug_print (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); @@ -608,7 +601,8 @@ private: } // Merge OLD_TYPE into this. On error throw exception. - bool merge (type& old_type, bool local_semantics, _Jv_BytecodeVerifier *verifier) + bool merge (type& old_type, bool local_semantics, + _Jv_BytecodeVerifier *verifier) { bool changed = false; bool refo = old_type.isreference (); @@ -671,8 +665,9 @@ private: { while (arraycount > 0) { - // FIXME: Class loader. - k = _Jv_GetArrayClass (k, NULL); + java::lang::ClassLoader *loader + = verifier->current_class->getClassLoader(); + k = _Jv_GetArrayClass (k, loader); --arraycount; } data.klass = k; @@ -903,7 +898,10 @@ private: subroutine = state_old->subroutine; changed = true; } - else + // If we're handling the result of an unmerged `ret', then we + // can't trust that it has the correct PC setting. So in this + // case we ignore what might otherwise look like a merge error. + else if (! state_old->is_unmerged_ret_state (max_locals)) verifier->verify_fail ("subroutines merged"); // Merge stacks. @@ -1013,7 +1011,11 @@ private: debug_print (" [local] "); for (i = 0; i < max_locals; ++i) locals[i].print (); - debug_print (" | %p\n", this); + if (subroutine == 0) + debug_print (" | None"); + else + debug_print (" | %4d", subroutine); + debug_print (" | %p\n", this); } #else inline void print (const char *, int, int, int) const @@ -2335,7 +2337,6 @@ private: break; case op_dup2_x2: { - // FIXME type t1 = pop_raw (); if (t1.iswide ()) { |