diff --git a/vm/interpreter/src/interpreter.cpp b/vm/interpreter/src/interpreter.cpp index 95939d2..c81bb2d 100644 --- a/vm/interpreter/src/interpreter.cpp +++ b/vm/interpreter/src/interpreter.cpp @@ -2595,7 +2595,6 @@ interpreter(StackFrame &frame) { if (!(state & INTERP_STATE_STACK_OVERFLOW)) { state |= INTERP_STATE_STACK_OVERFLOW; interp_throw_exception("java/lang/StackOverflowError"); - state &= ~INTERP_STATE_STACK_OVERFLOW; if (frame.framePopListener) frame_pop_callback(frame.framePopListener, frame.method, true); @@ -3090,6 +3089,12 @@ got_exception: frame.stack.pick().cr = COMPRESS_REF(frame.exc); frame.stack.ref() = FLAG_OBJECT; frame.exc = NULL; + + int &state = get_thread_ptr()->interpreter_state; + + if (state & INTERP_STATE_STACK_OVERFLOW) { + state &= ~INTERP_STATE_STACK_OVERFLOW; + } continue; } diff --git a/vm/vmcore/src/class_support/String_Pool.cpp b/vm/vmcore/src/class_support/String_Pool.cpp index aae525e..eadd7e9 100644 --- a/vm/vmcore/src/class_support/String_Pool.cpp +++ b/vm/vmcore/src/class_support/String_Pool.cpp @@ -339,7 +339,11 @@ ManagedObject * String_Pool::intern(String * str) { assert(env->VM_intern); vm_execute_java_method_array((jmethodID)env->VM_intern, (jvalue*)&string, args); - assert(!exn_raised()); + + if (exn_raised()) { //if RuntimeException or Error + return NULL; + } + //assert(!exn_raised()); assert(string); assert(string->object);