summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libjava/ChangeLog5
-rw-r--r--libjava/interpret.cc7
2 files changed, 7 insertions, 5 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 2705cee3344..356b3ba0ab7 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-29 Tom Tromey <tromey@redhat.com>
+
+ * interpret.cc (run) <insn_checkcast, checkcast_resolved>: Use
+ _Jv_CheckCast.
+
2005-06-28 Robin Green <greenrd@greenrd.org>
PR java/22189
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index 355b5b9054a..8b46dc6fa4a 100644
--- a/libjava/interpret.cc
+++ b/libjava/interpret.cc
@@ -25,7 +25,6 @@ details. */
#include <java/lang/StringBuffer.h>
#include <java/lang/Class.h>
#include <java/lang/reflect/Modifier.h>
-#include <java/lang/ClassCastException.h>
#include <java/lang/VirtualMachineError.h>
#include <java/lang/InternalError.h>
#include <java/lang/NullPointerException.h>
@@ -3022,8 +3021,7 @@ _Jv_InterpMethod::run (void *retp, ffi_raw *args, _Jv_InterpMethod *meth)
jclass to = (_Jv_Linker::resolve_pool_entry (meth->defining_class,
index)).clazz;
- if (value != NULL && ! to->isInstance (value))
- throw new java::lang::ClassCastException (to->getName());
+ value = (jobject) _Jv_CheckCast (to, value);
PUSHA (value);
@@ -3040,8 +3038,7 @@ _Jv_InterpMethod::run (void *retp, ffi_raw *args, _Jv_InterpMethod *meth)
SAVE_PC();
jobject value = POPA ();
jclass to = (jclass) AVAL ();
- if (value != NULL && ! to->isInstance (value))
- throw new java::lang::ClassCastException (to->getName());
+ value = (jobject) _Jv_CheckCast (to, value);
PUSHA (value);
}
NEXT_INSN;