Skip to content

Commit

Permalink
Fix possible invalid memory access when throwing exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
niner committed Jul 27, 2019
1 parent a001b7e commit 64a6f69
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/exceptions.c
Expand Up @@ -599,7 +599,9 @@ MVMObject * MVM_exception_backtrace_strings(MVMThreadContext *tc, MVMObject *ex_
else
MVM_exception_throw_adhoc(tc, "Op 'backtracestrings' needs an exception object");

arr = MVM_repr_alloc_init(tc, tc->instance->boot_types.BOOTArray);
MVMROOT(tc, ex, {
arr = MVM_repr_alloc_init(tc, tc->instance->boot_types.BOOTArray);
});
cur_frame = ex->body.origin;

MVMROOT2(tc, arr, cur_frame, {
Expand Down

0 comments on commit 64a6f69

Please sign in to comment.