From b116d819eb560f996bd027f83a9c9f78c52fc4c0 Mon Sep 17 00:00:00 2001 From: andrewmd5 <1297077+andrewmd5@users.noreply.github.com> Date: Sat, 22 Nov 2025 10:01:35 +0900 Subject: [PATCH 1/2] add asyncify_get_state --- src/passes/Asyncify.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/passes/Asyncify.cpp b/src/passes/Asyncify.cpp index cadf0871b4d..3089360e805 100644 --- a/src/passes/Asyncify.cpp +++ b/src/passes/Asyncify.cpp @@ -362,6 +362,7 @@ static const Name START_UNWIND = "start_unwind"; static const Name STOP_UNWIND = "stop_unwind"; static const Name START_REWIND = "start_rewind"; static const Name STOP_REWIND = "stop_rewind"; +static const Name GET_STATE = "get_state"; static const Name ASYNCIFY_GET_CALL_INDEX = "__asyncify_get_call_index"; static const Name ASYNCIFY_CHECK_CALL_INDEX = "__asyncify_check_call_index"; @@ -582,6 +583,8 @@ class ModuleAnalyzer { renamings[func->name] = ASYNCIFY_START_REWIND; } else if (func->base == STOP_REWIND) { renamings[func->name] = ASYNCIFY_STOP_REWIND; + } else if (func->base == GET_STATE) { + renamings[func->name] = ASYNCIFY_GET_STATE; } else { Fatal() << "call to unidenfied asyncify import: " << func->base; } From 1c59a1ce0b12f413141ce77f34c8e23225f88b74 Mon Sep 17 00:00:00 2001 From: andrewmd5 <1297077+andrewmd5@users.noreply.github.com> Date: Sat, 22 Nov 2025 10:07:28 +0900 Subject: [PATCH 2/2] fix fallthrough --- src/passes/Asyncify.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/passes/Asyncify.cpp b/src/passes/Asyncify.cpp index 3089360e805..a916d090654 100644 --- a/src/passes/Asyncify.cpp +++ b/src/passes/Asyncify.cpp @@ -640,6 +640,8 @@ class ModuleAnalyzer { } else if (target->base == STOP_REWIND) { info.canChangeState = true; info.isTopMostRuntime = true; + } else if (target->base == GET_STATE) { + info.canChangeState = false; } else { WASM_UNREACHABLE("call to unidenfied asyncify import"); }