ClassCastException, not a NullPointerException.
* src/vm/jit/intrp/asmpart.c (intrp_asm_handle_exception): Set
global_sp, in case the resolving of the catchtype involves the
execution of Java code.
* src/vm/jit/intrp/java.vmg (MONITORENTER): Check for exception.
(MONITOREXIT): Likewise.
Changes:
- $Id: asmpart.c 5668 2006-10-04 16:01:53Z edwin $
+ $Id: asmpart.c 5670 2006-10-04 18:23:19Z edwin $
*/
/* might fail, even if the result of the resolution would */
/* be an already loaded class. */
+ /* The resolving may involve Java code, so we need a usable */
+ /* global_sp. XXX is this a correct value for global_sp? */
+
+ global_sp = (Cell *)(((u1 *)fp) - framesize - SIZEOF_VOID_P);
+
c = resolve_classref_eager(cr.ref);
if (c == NULL) {
Changes:
- $Id: engine.c 5666 2006-10-04 15:04:52Z twisti $
+ $Id: engine.c 5670 2006-10-04 18:23:19Z edwin $
*/
#define THROW_CLASSCASTEXCEPTION(o) \
{ \
classcastexception_object = o; \
- THROW(nullpointerexception); \
+ THROW(classcastexception); \
}
#define CHECK_OUT_OF_BOUNDS(_array, _idx) \
MONITORENTER ( aRef -- )
{
#if defined(ENABLE_THREADS)
- /* CHECK_NULL_PTR(aRef); is now done explicitly */
- lock_monitor_enter(aRef);
+ /* CHECK_NULL_PTR(aRef); is now done explicitly inside lock_monitor_enter */
+ global_sp = sp;
+ if (!lock_monitor_enter(aRef))
+ THROW0;
+ CLEAR_global_sp;
#endif
}
MONITOREXIT ( aRef -- )
{
#if defined(ENABLE_THREADS)
- /* CHECK_NULL_PTR(aRef); cannot happen */
- lock_monitor_exit(aRef);
+ global_sp = sp;
+ if (!lock_monitor_exit(aRef))
+ THROW0;
+ CLEAR_global_sp;
#endif
}