binji opened issue #4765:
See https://github.com/WebAssembly/spec/issues/1522. It seems that there wasn't an explicit test for this case, and wasmtime's current behavior will be incorrect.
e.g.
(memory 1) (global i32 (i32.const 0) (data (global.get 0) "")
should be invalid, because a data segment initializer can't reference a non-imported global.
fitzgen commented on issue #4765:
Thanks for filing a bug report! However, this is already being rejected when I test locally:
$ wasmtime test.wat Error: failed to run main module `test.wat` Caused by: 0: failed to parse WebAssembly module 1: Invalid input WebAssembly code at offset 25: constant expression required: global.get of locally defined global
where
test.wat
is(module (memory 1) (global i32 (i32.const 0)) (data (global.get 0) ""))
fitzgen commented on issue #4765:
It is properly rejected all the way back to Wasmtime version 0.34.0, at least (released March of this year, at which point I stopped checking).
I think this can safely be closed as resolved.
Thanks again!
fitzgen closed issue #4765:
See https://github.com/WebAssembly/spec/issues/1522. It seems that there wasn't an explicit test for this case, and wasmtime's current behavior will be incorrect.
e.g.
(memory 1) (global i32 (i32.const 0) (data (global.get 0) "")
should be invalid, because a data segment initializer can't reference a non-imported global.
Cyborus04 commented on issue #4765:
Whoops that's my bad, I guess my version of wasmtime wasn't as up-to-date as I thought! Could've sworn I updated it recently, sorry.
fitzgen commented on issue #4765:
No worries! Better safe than sorry :)
Last updated: Nov 22 2024 at 16:03 UTC