-
Notifications
You must be signed in to change notification settings - Fork 793
Description
The type size_t
is not guaranteed to be 64-bit, but it looks like the code assumes in several places that it always is. We should replace size_t
with uint64_t
in all places where a strictly necessary 64-bit integer is required.
An example of where it looks like 64-bit integers are intended(?) is S2WasmBuilder
in https://github.com/WebAssembly/binaryen/blob/master/src/s2wasm.h#L50, and the size_t
members in https://github.com/WebAssembly/binaryen/blob/master/src/s2wasm.h#L90. These are explicitly parsed as unsigned long long
from https://github.com/WebAssembly/binaryen/blob/master/src/s2wasm-main.cpp#L86, indicating that these should be 64-bit always? However e.g. when building on Visual Studio on Windows as a 32-bit executable, size_t
is only 32-bit and truncation will occur.
In current executing form, in wasm runtime addresses are still 32-bit, but I presume the code intends to be forward compatible and operate on 64-bit integers for all addresses for the future when we might expand to a 64-bit address space?