mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8054224: Recursive method that was compiled by C1 is unable to catch StackOverflowError
Do not update exception cache if exception is replaced when thrown Reviewed-by: kvn, iveresov
This commit is contained in:
parent
dc1afd4abe
commit
fa334043fe
2 changed files with 50 additions and 1 deletions
|
@ -546,13 +546,18 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
|||
// normal bytecode execution.
|
||||
thread->clear_exception_oop_and_pc();
|
||||
|
||||
Handle original_exception(thread, exception());
|
||||
|
||||
continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false);
|
||||
// If an exception was thrown during exception dispatch, the exception oop may have changed
|
||||
thread->set_exception_oop(exception());
|
||||
thread->set_exception_pc(pc);
|
||||
|
||||
// the exception cache is used only by non-implicit exceptions
|
||||
if (continuation != NULL) {
|
||||
// Update the exception cache only when there didn't happen
|
||||
// another exception during the computation of the compiled
|
||||
// exception handler.
|
||||
if (continuation != NULL && original_exception() == exception()) {
|
||||
nm->add_handler_for_exception_and_pc(exception, pc, continuation);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue