Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null references to functions #3938

Open
sjamesr opened this issue Nov 26, 2024 · 0 comments
Open

null references to functions #3938

sjamesr opened this issue Nov 26, 2024 · 0 comments

Comments

@sjamesr
Copy link
Contributor

sjamesr commented Nov 26, 2024

I created WebAssembly/wasm-c-api#193, but I thought I'd cross-post the issue to see if anybody here has a solution.

I don't see a way to use wasm_c_api.h to create null function references. We have wasm_func_as_ref to turn non-null wasm_func_t into wasm_ref_t, but I'd like to be able to obtain a wasm_ref_t representing a null function.

Is this feature missing in the API, or am I just not seeing it?

BTW, the purpose is to be able to implement certain spec tests, such as

(assert_return (invoke "select-funcref" (ref.null func) (ref.null func) (i32.const 1)) (ref.null func))

(see the original test)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant