interpret.cc (run): Use _Jv_CheckCast.
authorTom Tromey <tromey@redhat.com>
Wed, 29 Jun 2005 16:18:53 +0000 (16:18 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Wed, 29 Jun 2005 16:18:53 +0000 (16:18 +0000)
* interpret.cc (run) <insn_checkcast, checkcast_resolved>: Use
_Jv_CheckCast.

From-SVN: r101427

libjava/ChangeLog
libjava/interpret.cc

index 2705cee3344bbf18b293dc9a22b46232548ad928..356b3ba0ab7793e52b1e9fd28f028e27d20d29bd 100644 (file)
@@ -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
index 355b5b9054a03bb8b6590596b197f42dca566a4a..8b46dc6fa4a2112eb226f75123026a06d415d598 100644 (file)
@@ -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;