Page MenuHomePhabricator

[WebAssembly] Add fence in __wasm_init_memory
AbandonedPublic

Authored by tlively on Sep 5 2019, 5:54 PM.

Details

Reviewers
aheejin
sbc100
Summary

memory.init is not atomic, so without the fence there is no
guarantee that the initialized memory is visible on other threads once
they have been woken up by the initializing thread.

Event Timeline

tlively created this revision.Sep 5 2019, 5:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 5 2019, 5:54 PM
aheejin added inline comments.Sep 5 2019, 7:45 PM
lld/wasm/Writer.cpp
733

In sequentially consistent models, wouldn't this store serve as the fence anyway?

tlively abandoned this revision.Sep 5 2019, 8:52 PM
tlively marked an inline comment as done.
tlively added inline comments.
lld/wasm/Writer.cpp
733

Yes, you're correct. I confused myself.