Stream: git-wasmtime

Topic: wasmtime / issue #4765 Update to wasm spec: data/element ...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 24 2022 at 00:15):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 24 2022 at 00:28):

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) ""))

view this post on Zulip Wasmtime GitHub notifications bot (Aug 24 2022 at 00:45):

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!

view this post on Zulip Wasmtime GitHub notifications bot (Aug 24 2022 at 00:45):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 24 2022 at 01:18):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 24 2022 at 16:30):

fitzgen commented on issue #4765:

No worries! Better safe than sorry :)


Last updated: Dec 23 2024 at 12:05 UTC