mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 06:55:07 +00:00
Allow converting the zero wasm address to native (#3215)
This allows to know the beginning of the wasm address space. At the moment to achieve that, we need to apply a `hack wasm_runtime_addr_app_to_native(X)-X` to get the beginning of WASM memory in the nativ code, but I don't see a good reason why not to allow zero address as a parameter value for this function.
This commit is contained in:
parent
df57e70437
commit
ce44e0ec0c
|
@ -426,15 +426,13 @@ wasm_runtime_addr_app_to_native(WASMModuleInstanceCommon *module_inst_comm,
|
|||
SHARED_MEMORY_UNLOCK(memory_inst);
|
||||
return addr;
|
||||
}
|
||||
}
|
||||
/* If bounds checks is disabled, return the address directly */
|
||||
else if (app_offset != 0) {
|
||||
SHARED_MEMORY_UNLOCK(memory_inst);
|
||||
return addr;
|
||||
}
|
||||
|
||||
SHARED_MEMORY_UNLOCK(memory_inst);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* If bounds checks is disabled, return the address directly */
|
||||
SHARED_MEMORY_UNLOCK(memory_inst);
|
||||
return addr;
|
||||
}
|
||||
|
||||
uint64
|
||||
|
|
Loading…
Reference in New Issue
Block a user