mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-08 20:56:13 +00:00
Fix configurable bounds checks typo (#2809)
This commit is contained in:
parent
9ad42290d8
commit
0b29904f26
|
@ -95,7 +95,7 @@ wasm_memory_init_with_allocator(void *_malloc_func, void *_realloc_func,
|
||||||
static inline bool
|
static inline bool
|
||||||
is_bounds_checks_enabled(WASMModuleInstanceCommon *module_inst)
|
is_bounds_checks_enabled(WASMModuleInstanceCommon *module_inst)
|
||||||
{
|
{
|
||||||
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
|
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
|
||||||
return wasm_runtime_is_bounds_checks_enabled(module_inst);
|
return wasm_runtime_is_bounds_checks_enabled(module_inst);
|
||||||
#else
|
#else
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -2581,7 +2581,7 @@ wasm_runtime_get_custom_data(WASMModuleInstanceCommon *module_inst_comm)
|
||||||
return module_inst->custom_data;
|
return module_inst->custom_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
|
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
|
||||||
void
|
void
|
||||||
wasm_runtime_set_bounds_checks(WASMModuleInstanceCommon *module_inst,
|
wasm_runtime_set_bounds_checks(WASMModuleInstanceCommon *module_inst,
|
||||||
bool enable)
|
bool enable)
|
||||||
|
|
|
@ -603,7 +603,7 @@ wasm_runtime_set_user_data(WASMExecEnv *exec_env, void *user_data);
|
||||||
WASM_RUNTIME_API_EXTERN void *
|
WASM_RUNTIME_API_EXTERN void *
|
||||||
wasm_runtime_get_user_data(WASMExecEnv *exec_env);
|
wasm_runtime_get_user_data(WASMExecEnv *exec_env);
|
||||||
|
|
||||||
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
|
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
|
||||||
/* See wasm_export.h for description */
|
/* See wasm_export.h for description */
|
||||||
WASM_RUNTIME_API_EXTERN void
|
WASM_RUNTIME_API_EXTERN void
|
||||||
wasm_runtime_set_bounds_checks(WASMModuleInstanceCommon *module_inst,
|
wasm_runtime_set_bounds_checks(WASMModuleInstanceCommon *module_inst,
|
||||||
|
|
|
@ -1181,7 +1181,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||||
uint8 value_type;
|
uint8 value_type;
|
||||||
#if !defined(OS_ENABLE_HW_BOUND_CHECK) \
|
#if !defined(OS_ENABLE_HW_BOUND_CHECK) \
|
||||||
|| WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS == 0
|
|| WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS == 0
|
||||||
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
|
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
|
||||||
bool disable_bounds_checks = !wasm_runtime_is_bounds_checks_enabled(
|
bool disable_bounds_checks = !wasm_runtime_is_bounds_checks_enabled(
|
||||||
(WASMModuleInstanceCommon *)module);
|
(WASMModuleInstanceCommon *)module);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -1207,7 +1207,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||||
uint8 opcode, local_type, *global_addr;
|
uint8 opcode, local_type, *global_addr;
|
||||||
#if !defined(OS_ENABLE_HW_BOUND_CHECK) \
|
#if !defined(OS_ENABLE_HW_BOUND_CHECK) \
|
||||||
|| WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS == 0
|
|| WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS == 0
|
||||||
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
|
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
|
||||||
bool disable_bounds_checks = !wasm_runtime_is_bounds_checks_enabled(
|
bool disable_bounds_checks = !wasm_runtime_is_bounds_checks_enabled(
|
||||||
(WASMModuleInstanceCommon *)module);
|
(WASMModuleInstanceCommon *)module);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -220,7 +220,7 @@ typedef struct WASMModuleInstanceExtraCommon {
|
||||||
CApiFuncImport *c_api_func_imports;
|
CApiFuncImport *c_api_func_imports;
|
||||||
/* pointer to the exec env currently used */
|
/* pointer to the exec env currently used */
|
||||||
WASMExecEnv *cur_exec_env;
|
WASMExecEnv *cur_exec_env;
|
||||||
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
|
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
|
||||||
/* Disable bounds checks or not */
|
/* Disable bounds checks or not */
|
||||||
bool disable_bounds_checks;
|
bool disable_bounds_checks;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -236,10 +236,10 @@ else
|
||||||
CFLAGS += -DWASM_ENABLE_LIBC_BUILTIN=0
|
CFLAGS += -DWASM_ENABLE_LIBC_BUILTIN=0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_INTERPRETERS_WAMR_CONFIGUABLE_BOUNDS_CHECKS),y)
|
ifeq ($(CONFIG_INTERPRETERS_WAMR_CONFIGURABLE_BOUNDS_CHECKS),y)
|
||||||
CFLAGS += -DWASM_CONFIGUABLE_BOUNDS_CHECKS=1
|
CFLAGS += -DWASM_CONFIGURABLE_BOUNDS_CHECKS=1
|
||||||
else
|
else
|
||||||
CFLAGS += -DWASM_CONFIGUABLE_BOUNDS_CHECKS=0
|
CFLAGS += -DWASM_CONFIGURABLE_BOUNDS_CHECKS=0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_INTERPRETERS_WAMR_LIBC_WASI),y)
|
ifeq ($(CONFIG_INTERPRETERS_WAMR_LIBC_WASI),y)
|
||||||
|
|
|
@ -69,7 +69,7 @@ print_help()
|
||||||
#endif
|
#endif
|
||||||
printf(" --repl Start a very simple REPL (read-eval-print-loop) mode\n"
|
printf(" --repl Start a very simple REPL (read-eval-print-loop) mode\n"
|
||||||
" that runs commands in the form of \"FUNC ARG...\"\n");
|
" that runs commands in the form of \"FUNC ARG...\"\n");
|
||||||
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
|
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
|
||||||
printf(" --disable-bounds-checks Disable bounds checks for memory accesses\n");
|
printf(" --disable-bounds-checks Disable bounds checks for memory accesses\n");
|
||||||
#endif
|
#endif
|
||||||
#if WASM_ENABLE_LIBC_WASI != 0
|
#if WASM_ENABLE_LIBC_WASI != 0
|
||||||
|
@ -571,7 +571,7 @@ main(int argc, char *argv[])
|
||||||
#endif
|
#endif
|
||||||
bool is_repl_mode = false;
|
bool is_repl_mode = false;
|
||||||
bool is_xip_file = false;
|
bool is_xip_file = false;
|
||||||
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
|
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
|
||||||
bool disable_bounds_checks = false;
|
bool disable_bounds_checks = false;
|
||||||
#endif
|
#endif
|
||||||
#if WASM_ENABLE_LIBC_WASI != 0
|
#if WASM_ENABLE_LIBC_WASI != 0
|
||||||
|
@ -638,7 +638,7 @@ main(int argc, char *argv[])
|
||||||
else if (!strcmp(argv[0], "--repl")) {
|
else if (!strcmp(argv[0], "--repl")) {
|
||||||
is_repl_mode = true;
|
is_repl_mode = true;
|
||||||
}
|
}
|
||||||
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
|
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
|
||||||
else if (!strcmp(argv[0], "--disable-bounds-checks")) {
|
else if (!strcmp(argv[0], "--disable-bounds-checks")) {
|
||||||
disable_bounds_checks = true;
|
disable_bounds_checks = true;
|
||||||
}
|
}
|
||||||
|
@ -886,7 +886,7 @@ main(int argc, char *argv[])
|
||||||
goto fail3;
|
goto fail3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
|
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
|
||||||
if (disable_bounds_checks) {
|
if (disable_bounds_checks) {
|
||||||
wasm_runtime_set_bounds_checks(wasm_module_inst, false);
|
wasm_runtime_set_bounds_checks(wasm_module_inst, false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user