MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / _Unwind_Resume

Function _Unwind_Resume

system/lib/libunwind/src/Unwind-seh.cpp:422–456  ·  view source on GitHub ↗

When \c _Unwind_RaiseException() is in phase2, it hands control to the personality function at each frame. The personality may force a jump to a landing pad in that function; the landing pad code may then call \c _Unwind_Resume() to continue with the unwinding. Note: the call to \c _Unwind_Resume() is from compiler generated user code. All other \c _Unwind_* routines are called by the C++ runti

Source from the content-addressed store, hash-verified

420/// is implemented by having the code call \c __cxa_rethrow() which
421/// in turn calls \c _Unwind_Resume_or_Rethrow().
422_LIBUNWIND_EXPORT void
423_Unwind_Resume(_Unwind_Exception *exception_object) {
424 _LIBUNWIND_TRACE_API("_Unwind_Resume(ex_obj=%p)", (void *)exception_object);
425
426 if (exception_object->private_[0] != 0) {
427 unw_context_t uc;
428
429 __unw_getcontext(&uc);
430 unwind_phase2_forced(&uc, exception_object,
431 (_Unwind_Stop_Fn) exception_object->private_[0],
432 (void *)exception_object->private_[4]);
433 } else {
434 // Recover the parameters for the unwind from the exception object
435 // so we can start unwinding again.
436 EXCEPTION_RECORD ms_exc;
437 CONTEXT ms_ctx;
438 UNWIND_HISTORY_TABLE hist;
439
440 memset(&ms_exc, 0, sizeof(ms_exc));
441 memset(&hist, 0, sizeof(hist));
442 ms_exc.ExceptionCode = STATUS_GCC_THROW;
443 ms_exc.ExceptionFlags = EXCEPTION_NONCONTINUABLE;
444 ms_exc.NumberParameters = 4;
445 ms_exc.ExceptionInformation[0] = (ULONG_PTR)exception_object;
446 ms_exc.ExceptionInformation[1] = exception_object->private_[1];
447 ms_exc.ExceptionInformation[2] = exception_object->private_[2];
448 ms_exc.ExceptionInformation[3] = exception_object->private_[3];
449 RtlUnwindEx((PVOID)exception_object->private_[1],
450 (PVOID)exception_object->private_[2], &ms_exc,
451 exception_object, &ms_ctx, &hist);
452 }
453
454 // Clients assume _Unwind_Resume() does not return, so all we can do is abort.
455 _LIBUNWIND_ABORT("_Unwind_Resume() can't return");
456}
457
458/// Not used by C++.
459/// Unwinds stack, calling "stop" function at each frame.

Callers

nothing calls this directly

Calls 2

memsetFunction · 0.85
unwind_phase2_forcedFunction · 0.70

Tested by

no test coverage detected