26 #include "src/trap-handler/handler-inside-win.h" 30 #include "src/trap-handler/trap-handler-internal.h" 31 #include "src/trap-handler/trap-handler.h" 35 namespace trap_handler {
37 bool TryHandleWasmTrap(EXCEPTION_POINTERS* exception) {
39 if (!IsThreadInWasm()) {
44 g_thread_in_wasm_code =
false;
46 const EXCEPTION_RECORD* record = exception->ExceptionRecord;
48 if (record->ExceptionCode != EXCEPTION_ACCESS_VIOLATION) {
55 if (TryFindLandingPad(fault_addr, &landing_pad)) {
56 exception->ContextRecord->Rip = landing_pad;
58 g_thread_in_wasm_code =
true;
68 LONG HandleWasmTrap(EXCEPTION_POINTERS* exception) {
69 if (TryHandleWasmTrap(exception)) {
70 return EXCEPTION_CONTINUE_EXECUTION;
72 return EXCEPTION_CONTINUE_SEARCH;