Skip to content

Commit d76e43d

Browse files
committed
Add wasm64 workarounds
1 parent 2337b38 commit d76e43d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

emscripten.py

+1
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,7 @@ def create_pointer_conversion_wrappers(metadata):
932932
'asyncify_start_rewind': '_p',
933933
'asyncify_start_unwind': '_p',
934934
'__get_exception_message': '_ppp',
935+
'_emval_coro_resume': '_pp',
935936
}
936937

937938
for function in settings.SIGNATURE_CONVERSIONS:

test/embind/test_val_coro.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
using namespace emscripten;
77

88
EM_JS(EM_VAL, promise_sleep_impl, (int ms, int result), {
9-
return Emval.toHandle(new Promise(resolve => setTimeout(resolve, ms, result)));
9+
let promise = new Promise(resolve => setTimeout(resolve, ms, result));
10+
let handle = Emval.toHandle(promise);
11+
// FIXME. See https://github.com/emscripten-core/emscripten/issues/16975.
12+
#if __wasm64__
13+
handle = BigInt(handle);
14+
#endif
15+
return handle;
1016
});
1117

1218
val promise_sleep(int ms, int result = 0) {

0 commit comments

Comments
 (0)