Stream: wasm

Topic: Mutability of globals in the store


view this post on Zulip Julien Cretin (ia0) (Sep 18 2022 at 15:53):

Hi, it's unclear to me what the embedder is allowed to do with the store. For example if a global is const, may 2 successive calls to global.get return different values? I would expect that yes and it would be a property of the embedder, but I can convince myself with the wording of the spec.

view this post on Zulip Julien Cretin (ia0) (Sep 26 2022 at 14:02):

Actually, I think the answer is no. It looks like only host function calls may modify the store (in "unexpected" ways). So 2 consecutive global.get to the same imported global cannot return different values (unless there is a host function call in between).

view this post on Zulip Lann Martin (Sep 26 2022 at 14:05):

(deleted)
Never mind, I see you are asking a more nuanced question.


Last updated: Dec 23 2024 at 12:05 UTC