mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2024-11-26 07:21:54 +00:00
Fix Windows/MSVC build issues (#1498)
Fix two issues of building WAMR on Windows: - The build_llvm.py script calls itself, spawning instances faster than they expire, which makes Python3 eat up the entire RAM in a pretty short time. - The MSVC compiler doesn't support preprocessor statements inside macro expressions. Two places inside bh_assert() were found.
This commit is contained in:
parent
12bbb9189c
commit
046f5f2212
|
@ -244,14 +244,18 @@ table_instantiate(AOTModuleInstance *module_inst, AOTModule *module,
|
|||
tbl_inst = aot_get_table_inst(module_inst, table_seg->table_index);
|
||||
bh_assert(tbl_inst);
|
||||
|
||||
#if WASM_ENABLE_REF_TYPES != 0
|
||||
bh_assert(
|
||||
table_seg->offset.init_expr_type == INIT_EXPR_TYPE_I32_CONST
|
||||
|| table_seg->offset.init_expr_type == INIT_EXPR_TYPE_GET_GLOBAL
|
||||
#if WASM_ENABLE_REF_TYPES != 0
|
||||
|| table_seg->offset.init_expr_type == INIT_EXPR_TYPE_FUNCREF_CONST
|
||||
|| table_seg->offset.init_expr_type == INIT_EXPR_TYPE_REFNULL_CONST
|
||||
|| table_seg->offset.init_expr_type
|
||||
== INIT_EXPR_TYPE_REFNULL_CONST);
|
||||
#else
|
||||
bh_assert(table_seg->offset.init_expr_type == INIT_EXPR_TYPE_I32_CONST
|
||||
|| table_seg->offset.init_expr_type
|
||||
== INIT_EXPR_TYPE_GET_GLOBAL);
|
||||
#endif
|
||||
);
|
||||
|
||||
/* Resolve table data base offset */
|
||||
if (table_seg->offset.init_expr_type == INIT_EXPR_TYPE_GET_GLOBAL) {
|
||||
|
|
|
@ -1587,17 +1587,21 @@ wasm_instantiate(WASMModule *module, bool is_sub_inst, uint32 stack_size,
|
|||
#endif
|
||||
|
||||
/* init vec(funcidx) or vec(expr) */
|
||||
bh_assert(
|
||||
table_seg->base_offset.init_expr_type == INIT_EXPR_TYPE_I32_CONST
|
||||
|| table_seg->base_offset.init_expr_type
|
||||
== INIT_EXPR_TYPE_GET_GLOBAL
|
||||
#if WASM_ENABLE_REF_TYPES != 0
|
||||
|| table_seg->base_offset.init_expr_type
|
||||
== INIT_EXPR_TYPE_FUNCREF_CONST
|
||||
|| table_seg->base_offset.init_expr_type
|
||||
== INIT_EXPR_TYPE_REFNULL_CONST
|
||||
bh_assert(table_seg->base_offset.init_expr_type
|
||||
== INIT_EXPR_TYPE_I32_CONST
|
||||
|| table_seg->base_offset.init_expr_type
|
||||
== INIT_EXPR_TYPE_GET_GLOBAL
|
||||
|| table_seg->base_offset.init_expr_type
|
||||
== INIT_EXPR_TYPE_FUNCREF_CONST
|
||||
|| table_seg->base_offset.init_expr_type
|
||||
== INIT_EXPR_TYPE_REFNULL_CONST);
|
||||
#else
|
||||
bh_assert(table_seg->base_offset.init_expr_type
|
||||
== INIT_EXPR_TYPE_I32_CONST
|
||||
|| table_seg->base_offset.init_expr_type
|
||||
== INIT_EXPR_TYPE_GET_GLOBAL);
|
||||
#endif
|
||||
);
|
||||
|
||||
if (table_seg->base_offset.init_expr_type
|
||||
== INIT_EXPR_TYPE_GET_GLOBAL) {
|
||||
|
|
|
@ -11,4 +11,4 @@ import sys
|
|||
script = (
|
||||
pathlib.Path(__file__).parent.joinpath("../build-scripts/build_llvm.py").resolve()
|
||||
)
|
||||
subprocess.check_call([sys.executable, script.name])
|
||||
subprocess.check_call([sys.executable, script])
|
||||
|
|
Loading…
Reference in New Issue
Block a user