Commit 1919a4e7 by Tom Tromey Committed by Tom Tromey

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
parent 73068e36
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> 2002-01-26 Andreas Tobler <a.tobler@schweiz.ch>
* nogc.cc: Remove warnings. * nogc.cc: Remove warnings.
......
...@@ -31,13 +31,6 @@ details. */ ...@@ -31,13 +31,6 @@ details. */
#include <stdio.h> #include <stdio.h>
#endif /* VERIFY_DEBUG */ #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, ...) static void debug_print (const char *fmt, ...)
__attribute__ ((format (printf, 1, 2))); __attribute__ ((format (printf, 1, 2)));
...@@ -608,7 +601,8 @@ private: ...@@ -608,7 +601,8 @@ private:
} }
// Merge OLD_TYPE into this. On error throw exception. // 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 changed = false;
bool refo = old_type.isreference (); bool refo = old_type.isreference ();
...@@ -671,8 +665,9 @@ private: ...@@ -671,8 +665,9 @@ private:
{ {
while (arraycount > 0) while (arraycount > 0)
{ {
// FIXME: Class loader. java::lang::ClassLoader *loader
k = _Jv_GetArrayClass (k, NULL); = verifier->current_class->getClassLoader();
k = _Jv_GetArrayClass (k, loader);
--arraycount; --arraycount;
} }
data.klass = k; data.klass = k;
...@@ -903,7 +898,10 @@ private: ...@@ -903,7 +898,10 @@ private:
subroutine = state_old->subroutine; subroutine = state_old->subroutine;
changed = true; 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"); verifier->verify_fail ("subroutines merged");
// Merge stacks. // Merge stacks.
...@@ -1013,6 +1011,10 @@ private: ...@@ -1013,6 +1011,10 @@ private:
debug_print (" [local] "); debug_print (" [local] ");
for (i = 0; i < max_locals; ++i) for (i = 0; i < max_locals; ++i)
locals[i].print (); locals[i].print ();
if (subroutine == 0)
debug_print (" | None");
else
debug_print (" | %4d", subroutine);
debug_print (" | %p\n", this); debug_print (" | %p\n", this);
} }
#else #else
...@@ -2335,7 +2337,6 @@ private: ...@@ -2335,7 +2337,6 @@ private:
break; break;
case op_dup2_x2: case op_dup2_x2:
{ {
// FIXME
type t1 = pop_raw (); type t1 = pop_raw ();
if (t1.iswide ()) if (t1.iswide ())
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment