Skip to content

Commit

Permalink
Fix sgx platform issues (bytecodealliance#916)
Browse files Browse the repository at this point in the history
Fix ocall_poll incorrectly defined issue in which poll_fds should be defined as [in, out]
Fix is_xip_file incorrectly check issue
  • Loading branch information
wenyongh authored Dec 28, 2021
1 parent 89a1c82 commit 635084c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/shared/platform/linux-sgx/sgx_wamr.edl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ enclave {
[out, size=buf_len]char *buf,
unsigned int buf_len);
int ocall_posix_fallocate(int fd, off_t offset, off_t len);
int ocall_poll([out, size=fds_len]void *fds, unsigned nfds,
int ocall_poll([in, out, size=fds_len]void *fds, unsigned nfds,
int timeout, unsigned int fds_len);

int ocall_getopt(int argc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,11 @@ handle_cmd_load_module(uint64 *args, uint32 argc)
enclave_module->wasm_file = (uint8 *)enclave_module + sizeof(EnclaveModule);
bh_memcpy_s(enclave_module->wasm_file, wasm_file_size, wasm_file,
wasm_file_size);
if (is_xip_file) {
enclave_module->is_xip_file = true;
}

if (!(enclave_module->module =
wasm_runtime_load(enclave_module->wasm_file, wasm_file_size,
error_buf, error_buf_size))) {
if (!is_xip_file)
if (!enclave_module->is_xip_file)
wasm_runtime_free(enclave_module);
else
os_munmap(enclave_module, (uint32)total_size);
Expand Down

0 comments on commit 635084c

Please sign in to comment.