mkxp-z/binding-sandbox
刘皓 b68dae451d
Zero out memory allocated by wasm-rt
In release 1.0 of the WebAssembly Specification, it says that all the
bytes in WebAssembly memory need to be initialized to 0 on creation of
the memory, and when memory is grown, the new bytes also need to be
initialized to 0.

It seems this zeroing behaviour is indeed required for the sandbox to
operate correctly. Not zeroing leads to undefined behaviour. This
manifested as a crash that occurred when restarting the libretro core,
but for some reason, only on Emscripten. Not sure why this didn't happen
on other platforms. Even sanitizers weren't able to detect the bug!

(cherry picked from commit edf061e323b8f0ab0c6a72c76ae7ccc07a1649c0)
2025-03-02 14:05:49 -05:00
..
audio-binding.h Replace WABT's WebAssembly runtime with a custom implementation 2025-02-11 20:40:55 -05:00
binding-base.cpp Make sandbox_malloc into a coroutine 2025-02-17 00:38:40 -05:00
binding-base.h Make sandbox_malloc into a coroutine 2025-02-17 00:38:40 -05:00
binding-sandbox.h Replace WABT's WebAssembly runtime with a custom implementation 2025-02-11 20:40:55 -05:00
binding-util.cpp Start writing class/method stubs for binding-sandbox 2025-01-21 12:56:17 -05:00
binding-util.h Make sandbox_malloc into a coroutine 2025-02-17 00:38:40 -05:00
bitmap-binding.h Make sandbox_malloc into a coroutine 2025-02-17 00:38:40 -05:00
core.h Replace WABT's WebAssembly runtime with a custom implementation 2025-02-11 20:40:55 -05:00
etc-binding.h Make sandbox_malloc into a coroutine 2025-02-17 00:38:40 -05:00
font-binding.h Make sandbox_malloc into a coroutine 2025-02-17 00:38:40 -05:00
graphics-binding.h Implement plane bindings for binding-sandbox 2025-02-06 19:44:34 -05:00
input-binding.h Start implementing input for libretro builds 2025-02-04 23:47:54 -05:00
plane-binding.h Make sandbox_malloc into a coroutine 2025-02-17 00:38:40 -05:00
sandbox.cpp Use libretro's PlayStation 3 Docker image instead of ScummVM's 2025-02-22 16:04:51 -05:00
sandbox.h Make sandbox_malloc into a coroutine 2025-02-17 00:38:40 -05:00
sprite-binding.h Make sandbox_malloc into a coroutine 2025-02-17 00:38:40 -05:00
table-binding.h Make sandbox_malloc into a coroutine 2025-02-17 00:38:40 -05:00
tilemap-binding.h Make sandbox_malloc into a coroutine 2025-02-17 00:38:40 -05:00
types.h Refactor the non-autogenerated parts of sandbox-bindgen into separate files 2025-02-05 01:11:23 -05:00
viewport-binding.h Make sandbox_malloc into a coroutine 2025-02-17 00:38:40 -05:00
wasi.cpp Remove dependency on xxd 2025-02-27 23:32:30 -05:00
wasi.h Replace WABT's WebAssembly runtime with a custom implementation 2025-02-11 20:40:55 -05:00
wasm-rt.cpp Zero out memory allocated by wasm-rt 2025-03-02 14:05:49 -05:00
wasm-rt.h Rename wasm-rt symbols to reduce probability of symbol conflicts with libretro frontend 2025-03-02 13:49:19 -05:00
window-binding.h Make sandbox_malloc into a coroutine 2025-02-17 00:38:40 -05:00