Skip to content

Commit 8ea918a

Browse files
committed
fix compile error, making it work with AOT
1 parent 795375d commit 8ea918a

File tree

4 files changed

+26
-27
lines changed

4 files changed

+26
-27
lines changed

core/iwasm/common/wasm_runtime_common.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,28 @@ static korp_mutex loading_module_list_lock;
8585
static bh_list registered_module_list_head;
8686
static bh_list *const registered_module_list = &registered_module_list_head;
8787
static korp_mutex registered_module_list_lock;
88+
89+
void
90+
wasm_runtime_propagate_exception_from_import(
91+
WASMModuleInstanceCommon *parent, WASMModuleInstanceCommon *sub_module)
92+
{
93+
static const char exception_prefix[] = "Exception: ";
94+
const char *message = NULL;
95+
96+
if (!parent || !sub_module)
97+
return;
98+
99+
message = wasm_get_exception(sub_module);
100+
if (message && message[0] != '\0') {
101+
if (!strncmp(message, exception_prefix, sizeof(exception_prefix) - 1)) {
102+
message += sizeof(exception_prefix) - 1;
103+
}
104+
105+
wasm_set_exception(parent, message);
106+
wasm_set_exception(sub_module, NULL);
107+
}
108+
}
109+
88110
static void
89111
wasm_runtime_destroy_registered_module_list(void);
90112
#endif /* WASM_ENABLE_MULTI_MODULE */

core/iwasm/common/wasm_runtime_common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,10 @@ typedef struct WASMRegisteredModule {
578578
uint8 *orig_file_buf;
579579
uint32 orig_file_buf_size;
580580
} WASMRegisteredModule;
581+
582+
void
583+
wasm_runtime_propagate_exception_from_import(
584+
WASMModuleInstanceCommon *parent, WASMModuleInstanceCommon *sub_module);
581585
#endif
582586

583587
typedef package_type_t PackageType;

core/iwasm/interpreter/wasm_runtime.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -103,29 +103,6 @@ wasm_resolve_symbols(WASMModule *module)
103103
return ret;
104104
}
105105

106-
#if WASM_ENABLE_MULTI_MODULE != 0
107-
void
108-
wasm_runtime_propagate_exception_from_import(WASMModuleInstance *parent,
109-
WASMModuleInstance *sub_module)
110-
{
111-
static const char exception_prefix[] = "Exception: ";
112-
const char *message = NULL;
113-
114-
if (!parent || !sub_module)
115-
return;
116-
117-
message = wasm_get_exception(sub_module);
118-
if (message && message[0] != '\0') {
119-
if (!strncmp(message, exception_prefix, sizeof(exception_prefix) - 1)) {
120-
message += sizeof(exception_prefix) - 1;
121-
}
122-
123-
wasm_set_exception(parent, message);
124-
wasm_set_exception(sub_module, NULL);
125-
}
126-
}
127-
#endif
128-
129106
#if WASM_ENABLE_MULTI_MODULE != 0
130107
static WASMFunction *
131108
wasm_resolve_function(const char *module_name, const char *function_name,

core/iwasm/interpreter/wasm_runtime.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,10 +593,6 @@ wasm_lookup_tag(const WASMModuleInstance *module_inst, const char *name,
593593
const char *signature);
594594
#endif
595595

596-
void
597-
wasm_runtime_propagate_exception_from_import(WASMModuleInstance *parent,
598-
WASMModuleInstance *sub_module);
599-
600596
#endif
601597

602598
bool

0 commit comments

Comments
 (0)