You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is implemented using std::strcpy, which stops copying when it encounters \0. It seems like more often than not, it's used to hold bytes of a Wasm binary (as a vec<byte_t>). But Wasm binaries start with \0asm, so nothing will be copied.
I'm not sure if there are other specializations where stopping at the first \0 makes sense. Considering that we already have vec::make(std::string), perhaps vec::make_nt isn't so helpful and we may want to consider removing it.
I refer to
vec<T>::make_nt
:wasm-c-api/include/wasm.hh
Lines 154 to 158 in 2ce1367
This is implemented using
std::strcpy
, which stops copying when it encounters\0
. It seems like more often than not, it's used to hold bytes of a Wasm binary (as avec<byte_t>
). But Wasm binaries start with\0asm
, so nothing will be copied.I'm not sure if there are other specializations where stopping at the first
\0
makes sense. Considering that we already havevec::make(std::string)
, perhapsvec::make_nt
isn't so helpful and we may want to consider removing it.#149 is also related.
The text was updated successfully, but these errors were encountered: