diff --git a/src/node_wasi.cc b/src/node_wasi.cc index e4503a8c6a70dc..4c06761c6ac1ce 100644 --- a/src/node_wasi.cc +++ b/src/node_wasi.cc @@ -258,12 +258,12 @@ R WASI::WasiFunction::FastCallback( THROW_ERR_WASI_NOT_STARTED(isolate); return EinvalError(); } - Local ab = wasi->memory_.Get(isolate)->Buffer(); - size_t mem_size = ab->ByteLength(); - char* mem_data = static_cast(ab->Data()); - CHECK_NOT_NULL(mem_data); + uint8_t* memory = nullptr; + CHECK(LIKELY(options.wasm_memory->getStorageIfAligned(&memory))); - return F(*wasi, {mem_data, mem_size}, args...); + return F(*wasi, + {reinterpret_cast(memory), options.wasm_memory->length()}, + args...); } namespace {