diff options
Diffstat (limited to 'thread_none.c')
-rw-r--r-- | thread_none.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/thread_none.c b/thread_none.c index cf4658e571..a82ced684e 100644 --- a/thread_none.c +++ b/thread_none.c @@ -15,6 +15,10 @@ #include <time.h> +#if defined(__wasm__) && !defined(__EMSCRIPTEN__) +# include "wasm/machine.h" +#endif + #define TIME_QUANTUM_MSEC (100) #define TIME_QUANTUM_USEC (TIME_QUANTUM_MSEC * 1000) #define TIME_QUANTUM_NSEC (TIME_QUANTUM_USEC * 1000) @@ -143,6 +147,9 @@ ruby_init_stack(volatile VALUE *addr) static int native_thread_init_stack(rb_thread_t *th) { +#if defined(__wasm__) && !defined(__EMSCRIPTEN__) + th->ec->machine.stack_start = (VALUE *)rb_wasm_stack_get_base(); +#endif return 0; // success } |