diff --git a/.github/workflows/compilation_on_android_ubuntu.yml b/.github/workflows/compilation_on_android_ubuntu.yml index 3d6e44c6..6b653b50 100644 --- a/.github/workflows/compilation_on_android_ubuntu.yml +++ b/.github/workflows/compilation_on_android_ubuntu.yml @@ -151,9 +151,7 @@ jobs: exclude: # uncompatiable feature and platform # uncompatiable mode and feature - # MULTI_MODULE only on INTERP mode - - make_options_run_mode: $AOT_BUILD_OPTIONS - make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1" + # MULTI_MODULE only on INTERP mode and AOT mode - make_options_run_mode: $FAST_JIT_BUILD_OPTIONS make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1" - make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS @@ -494,9 +492,7 @@ jobs: test_option: $SIMD_TEST_OPTIONS - running_mode: "fast-interp" test_option: $SIMD_TEST_OPTIONS - # aot and jit don't support multi module - - running_mode: "aot" - test_option: $MULTI_MODULES_TEST_OPTIONS + # llvm jit doesn't support multi module - running_mode: "jit" test_option: $MULTI_MODULES_TEST_OPTIONS # fast-jit doesn't support multi module, simd diff --git a/.github/workflows/compilation_on_macos.yml b/.github/workflows/compilation_on_macos.yml index f0683318..aac16898 100644 --- a/.github/workflows/compilation_on_macos.yml +++ b/.github/workflows/compilation_on_macos.yml @@ -133,13 +133,11 @@ jobs: exclude: # uncompatiable feature and platform # uncompatiable mode and feature - # MULTI_MODULE only on INTERP mode + # MULTI_MODULE only on INTERP mode and AOT mode - make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1" - make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1" - - make_options_run_mode: $AOT_BUILD_OPTIONS - make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1" # SIMD only on JIT/AOT mode - make_options_run_mode: $CLASSIC_INTERP_BUILD_OPTIONS make_options_feature: "-DWAMR_BUILD_SIMD=1" diff --git a/.github/workflows/compilation_on_sgx.yml b/.github/workflows/compilation_on_sgx.yml index dd631706..0d19d83a 100644 --- a/.github/workflows/compilation_on_sgx.yml +++ b/.github/workflows/compilation_on_sgx.yml @@ -101,9 +101,6 @@ jobs: platform: [linux-sgx] exclude: # uncompatiable mode and feature - # MULTI_MODULE only on INTERP mode - - make_options_run_mode: $AOT_BUILD_OPTIONS - make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1" # MINI_LOADER only on INTERP mode - make_options_run_mode: $AOT_BUILD_OPTIONS make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1" diff --git a/.github/workflows/nightly_run.yml b/.github/workflows/nightly_run.yml index ea79b3f2..bef63979 100644 --- a/.github/workflows/nightly_run.yml +++ b/.github/workflows/nightly_run.yml @@ -127,9 +127,7 @@ jobs: exclude: # uncompatiable feature and platform # uncompatiable mode and feature - # MULTI_MODULE only on INTERP mode - - make_options_run_mode: $AOT_BUILD_OPTIONS - make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1" + # MULTI_MODULE only on INTERP mode and AOT mode - make_options_run_mode: $FAST_JIT_BUILD_OPTIONS make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1" - make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS @@ -252,7 +250,7 @@ jobs: exclude: # uncompatiable feature and platform # uncompatiable mode and feature - # MULTI_MODULE only on INTERP mode + # MULTI_MODULE only on INTERP mode and AOT mode - make_options_run_mode: $FAST_JIT_BUILD_OPTIONS make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1" # SIMD only on JIT/AOT mode @@ -553,9 +551,7 @@ jobs: test_option: $SIMD_TEST_OPTIONS - running_mode: "fast-interp" test_option: $SIMD_TEST_OPTIONS - # aot and jit don't support multi module - - running_mode: "aot" - test_option: $MULTI_MODULES_TEST_OPTIONS + # llvm jit doesn't support multi module - running_mode: "jit" test_option: $MULTI_MODULES_TEST_OPTIONS # fast-jit doesn't support multi module, simd @@ -660,4 +656,4 @@ jobs: timeout-minutes: 40 if: env.TEST_ON_X86_32 == 'true' run: ./test_wamr.sh ${{ env.X86_32_TARGET_TEST_OPTIONS }} ${{ matrix.test_option }} -t ${{ matrix.running_mode }} - working-directory: ./tests/wamr-test-suites \ No newline at end of file + working-directory: ./tests/wamr-test-suites diff --git a/core/iwasm/aot/aot_loader.c b/core/iwasm/aot/aot_loader.c index 6e2fc324..6575c8ac 100644 --- a/core/iwasm/aot/aot_loader.c +++ b/core/iwasm/aot/aot_loader.c @@ -2955,18 +2955,21 @@ create_module(char *error_buf, uint32 error_buf_size) { AOTModule *module = loader_malloc(sizeof(AOTModule), error_buf, error_buf_size); - bh_list_status ret; + if (!module) { return NULL; } + module->module_type = Wasm_Module_AoT; + #if WASM_ENABLE_MULTI_MODULE != 0 module->import_module_list = &module->import_module_list_head; ret = bh_list_init(module->import_module_list); bh_assert(ret == BH_LIST_SUCCESS); #endif (void)ret; + return module; } diff --git a/core/iwasm/common/wasm_runtime_common.c b/core/iwasm/common/wasm_runtime_common.c index d5c40d6e..8faa5e44 100644 --- a/core/iwasm/common/wasm_runtime_common.c +++ b/core/iwasm/common/wasm_runtime_common.c @@ -126,13 +126,11 @@ runtime_malloc(uint64 size, WASMModuleInstanceCommon *module_inst, } #if WASM_ENABLE_MULTI_MODULE != 0 -/* - TODO: - Let loader_malloc be a general API both for AOT and WASM. -*/ +/* TODO: Let loader_malloc be a general API both for AOT and WASM. */ #define loader_malloc(size, error_buf, error_buf_size) \ runtime_malloc(size, NULL, error_buf, error_buf_size) + static void set_error_buf_v(const WASMModuleCommon *module, char *error_buf, uint32 error_buf_size, const char *format, ...) diff --git a/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c b/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c index 415a6646..0ba91a7e 100644 --- a/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c +++ b/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c @@ -710,8 +710,8 @@ fd_object_release(wasm_exec_env_t env, struct fd_object *fo) bool fd_table_insert_existing(struct fd_table *ft, __wasi_fd_t in, int out) { - __wasi_filetype_t type; - __wasi_rights_t rights_base, rights_inheriting; + __wasi_filetype_t type = __WASI_FILETYPE_UNKNOWN; + __wasi_rights_t rights_base = 0, rights_inheriting = 0; struct fd_object *fo; __wasi_errno_t error; diff --git a/product-mini/platforms/posix/main.c b/product-mini/platforms/posix/main.c index b7d75541..b27bd8c2 100644 --- a/product-mini/platforms/posix/main.c +++ b/product-mini/platforms/posix/main.c @@ -422,7 +422,7 @@ static bool module_reader_callback(package_type_t module_type, const char *module_name, uint8 **p_buffer, uint32 *p_size) { - char *file_format; + char *file_format = NULL; #if WASM_ENABLE_INTERP != 0 if (module_type == Wasm_Module_Bytecode) file_format = ".wasm"; @@ -430,8 +430,8 @@ module_reader_callback(package_type_t module_type, const char *module_name, #if WASM_ENABLE_AOT != 0 if (module_type == Wasm_Module_AoT) file_format = ".aot"; - #endif + bh_assert(file_format); const char *format = "%s/%s%s"; int sz = strlen(module_search_path) + strlen("/") + strlen(module_name) + strlen(file_format) + 1; diff --git a/product-mini/platforms/windows/main.c b/product-mini/platforms/windows/main.c index 985c9e6c..f6347919 100644 --- a/product-mini/platforms/windows/main.c +++ b/product-mini/platforms/windows/main.c @@ -206,7 +206,7 @@ static bool module_reader_callback(package_type_t module_type, const char *module_name, uint8 **p_buffer, uint32 *p_size) { - char *file_format; + char *file_format = NULL; #if WASM_ENABLE_INTERP != 0 if (module_type == Wasm_Module_Bytecode) file_format = ".wasm"; @@ -214,8 +214,8 @@ module_reader_callback(package_type_t module_type, const char *module_name, #if WASM_ENABLE_AOT != 0 if (module_type == Wasm_Module_AoT) file_format = ".aot"; - #endif + bh_assert(file_format); const char *format = "%s/%s%s"; int sz = strlen(module_search_path) + strlen("/") + strlen(module_name) + strlen(file_format) + 1;