Skip to content

Commit

Permalink
Fix possible access to fromspace in panic_unhandled_ex
Browse files Browse the repository at this point in the history
MVM_debugserver_notify_unhandled_exception will actually enter the garbage
collector, so the ex pointer may get outdated by that call.
  • Loading branch information
niner committed Apr 23, 2020
1 parent 5f783ec commit 49ac793
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/exceptions.c
Expand Up @@ -667,7 +667,9 @@ static void panic_unhandled_ex(MVMThreadContext *tc, MVMException *ex) {
char *backtrace;

/* If a debug session is running, notify the client. */
MVM_debugserver_notify_unhandled_exception(tc, ex);
MVMROOT(tc, ex, {
MVM_debugserver_notify_unhandled_exception(tc, ex);
});

/* If it's a control exception, try promoting it to a catch one; use
* the category name. */
Expand Down

0 comments on commit 49ac793

Please sign in to comment.