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

Wrong type error when validating globals with gc proposal features #2407

Open
ShinWonho opened this issue Apr 2, 2024 · 0 comments
Open

Comments

@ShinWonho
Copy link

ShinWonho commented Apr 2, 2024

In the GC proposal, it allows using previous global value as an initializer expression.

Screenshot 2024-04-02 at 7 03 26 PM

Therefore, following wasm module is a valid module in the GC proposal.

;; global.wat
(module (global i32 (i32.const 0)) (global i32 (global.get 0)))

I run the module with the reference interpreter in the gc proposal, and it passes the validation.

$ gc/interperter/wasm global.wat
// terminates normally

As the reference interpreter also includes function references and tail call proposals, I enable all of them and run wat2wasm, but it raises type error.

$ wabt/bin/wat2wasm --enable-function-references --enable-tail-call --enable-gc global.wat
global.wat:1:60: error: initializer expression can only reference an imported global
(module (global i32 (i32.const 0)) (global i32 (global.get 0)))
                                                           ^
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