Skip to content

Commit a343a7f

Browse files
Guard remaining bare calls to non-componentized functions
Now the following command should succeed: ``` env RUBY_WASM_EXPERIMENTAL_COMPONENT_MODEL=1 \ bundle exec rbwasm build --ruby-version head \ --target wasm32-unknown-wasip1 --build-profile full \ --no-stdlib -o /dev/null ```
1 parent 48fda0f commit a343a7f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/gems/js/ext/js/witapi-core.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,18 @@ void *rb_wasm_handle_fiber_unwind(void (**new_fiber_entry)(void *, void *),
5555

5656
static bool rb_should_prohibit_rewind = false;
5757

58+
#ifdef JS_ENABLE_COMPONENT_MODEL
59+
void rb_wasm_throw_prohibit_rewind_exception(const char *c_msg,
60+
size_t msg_len) {
61+
ext_string_t message = {.ptr = (uint8_t *)c_msg, .len = msg_len};
62+
ruby_js_js_runtime_throw_prohibit_rewind_exception(&message);
63+
}
64+
#else
5865
__attribute__((import_module("rb-js-abi-host"),
5966
import_name("rb_wasm_throw_prohibit_rewind_exception")))
6067
__attribute__((noreturn)) void
6168
rb_wasm_throw_prohibit_rewind_exception(const char *c_msg, size_t msg_len);
69+
#endif
6270

6371
#define RB_WASM_CHECK_REWIND_PROHIBITED(msg) \
6472
/* \

0 commit comments

Comments
 (0)