diff --git a/core/shared/platform/linux-sgx/sgx_wamr.edl b/core/shared/platform/linux-sgx/sgx_wamr.edl index b8985396f..0a47fcbb2 100644 --- a/core/shared/platform/linux-sgx/sgx_wamr.edl +++ b/core/shared/platform/linux-sgx/sgx_wamr.edl @@ -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, diff --git a/product-mini/platforms/linux-sgx/enclave-sample/Enclave/Enclave.cpp b/product-mini/platforms/linux-sgx/enclave-sample/Enclave/Enclave.cpp index 5a05d298e..25bc75258 100644 --- a/product-mini/platforms/linux-sgx/enclave-sample/Enclave/Enclave.cpp +++ b/product-mini/platforms/linux-sgx/enclave-sample/Enclave/Enclave.cpp @@ -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);