aboutsummaryrefslogtreecommitdiff
path: root/libjava/interpret.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/interpret.cc')
-rw-r--r--libjava/interpret.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index 355b5b9..8b46dc6 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;