Say "memory" instead of "__wasi_memory" in error messages.

While the "__wasi_memory" name is something we considered, the name
currently being used for the memory exported to WASI is "memory", so
adjust the error message accordingly.
This commit is contained in:
Dan Gohman
2019-08-08 10:54:50 -07:00
committed by Jakub Konka
parent 1491f31531
commit 36b4ff8031
2 changed files with 3 additions and 3 deletions

View File

@@ -44,11 +44,11 @@ unsafe fn decode_ptr(
// Ok, translate the address.
Ok((((*definition).base as usize) + (ptr as usize)) as *mut u8)
}
// No export named "__wasi_memory", or the export isn't a memory.
// No export named "memory", or the export isn't a memory.
// FIXME: Is EINVAL the best code here?
x => {
println!(
"!!! no export named __wasi_memory, or the export isn't a mem: {:?}",
"!!! no export named \"memory\", or the export isn't a mem: {:?}",
x
);
Err(host::__WASI_EINVAL as host::__wasi_errno_t)

View File

@@ -30,7 +30,7 @@ fn get_memory(vmctx: &mut VMContext) -> Result<&mut [u8], host::__wasi_errno_t>
)),
x => {
println!(
"!!! no export named __wasi_memory, or the export isn't a mem: {:?}",
"!!! no export named \"memory\", or the export isn't a mem: {:?}",
x
);
Err(host::__WASI_EINVAL)