Skip to content

Commit

Permalink
[wasm] Fix the propagation of exceptions through runtime invokes.
Browse files Browse the repository at this point in the history
The previous code would convert exceptions into errors which would
be rethrown later, clearing the resume state.

Hopefully fixes dotnet#38337.
  • Loading branch information
vargaz committed Jul 14, 2020
1 parent 74be072 commit ba68fb5
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 ba68fb5

Please sign in to comment.