Skip to content

Commit

Permalink
[wasm] Fix the propagation of exceptions through runtime invokes. (#3…
Browse files Browse the repository at this point in the history
…9316)

The previous code would convert exceptions into errors which would
be rethrown later, clearing the resume state.

Hopefully fixes #38337.

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
  • Loading branch information
monojenkins and vargaz committed Jul 15, 2020
1 parent 60ccaa8 commit c80cc2a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/mono/mono/mini/interp/interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1913,12 +1913,10 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject
context->stack_pointer = (guchar*)sp;

if (context->has_resume_state) {
// This can happen on wasm !?
MonoException *thrown_exc = (MonoException*) mono_gchandle_get_target_internal (context->exc_gchandle);
if (exc)
*exc = (MonoObject*)thrown_exc;
else
mono_error_set_exception_instance (error, thrown_exc);
/*
* This can happen on wasm where native frames cannot be skipped during EH.
* EH processing will continue when control returns to the interpreter.
*/
return NULL;
}
return (MonoObject*)result.data.p;
Expand Down

0 comments on commit c80cc2a

Please sign in to comment.