Fix configurable bounds checks typo (#2809)

This commit is contained in:
Huang Qi 2023-11-21 17:32:45 +08:00 committed by GitHub
parent 9ad42290d8
commit 0b29904f26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 13 additions and 13 deletions

View File

@ -95,7 +95,7 @@ wasm_memory_init_with_allocator(void *_malloc_func, void *_realloc_func,
static inline bool
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);
#else
return true;

View File

@ -2581,7 +2581,7 @@ wasm_runtime_get_custom_data(WASMModuleInstanceCommon *module_inst_comm)
return module_inst->custom_data;
}
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
void
wasm_runtime_set_bounds_checks(WASMModuleInstanceCommon *module_inst,
bool enable)

View File

@ -603,7 +603,7 @@ wasm_runtime_set_user_data(WASMExecEnv *exec_env, void *user_data);
WASM_RUNTIME_API_EXTERN void *
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 */
WASM_RUNTIME_API_EXTERN void
wasm_runtime_set_bounds_checks(WASMModuleInstanceCommon *module_inst,

View File

@ -1181,7 +1181,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
uint8 value_type;
#if !defined(OS_ENABLE_HW_BOUND_CHECK) \
|| 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(
(WASMModuleInstanceCommon *)module);
#else

View File

@ -1207,7 +1207,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
uint8 opcode, local_type, *global_addr;
#if !defined(OS_ENABLE_HW_BOUND_CHECK) \
|| 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(
(WASMModuleInstanceCommon *)module);
#else

View File

@ -220,7 +220,7 @@ typedef struct WASMModuleInstanceExtraCommon {
CApiFuncImport *c_api_func_imports;
/* pointer to the exec env currently used */
WASMExecEnv *cur_exec_env;
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
/* Disable bounds checks or not */
bool disable_bounds_checks;
#endif

View File

@ -236,10 +236,10 @@ else
CFLAGS += -DWASM_ENABLE_LIBC_BUILTIN=0
endif
ifeq ($(CONFIG_INTERPRETERS_WAMR_CONFIGUABLE_BOUNDS_CHECKS),y)
CFLAGS += -DWASM_CONFIGUABLE_BOUNDS_CHECKS=1
ifeq ($(CONFIG_INTERPRETERS_WAMR_CONFIGURABLE_BOUNDS_CHECKS),y)
CFLAGS += -DWASM_CONFIGURABLE_BOUNDS_CHECKS=1
else
CFLAGS += -DWASM_CONFIGUABLE_BOUNDS_CHECKS=0
CFLAGS += -DWASM_CONFIGURABLE_BOUNDS_CHECKS=0
endif
ifeq ($(CONFIG_INTERPRETERS_WAMR_LIBC_WASI),y)

View File

@ -69,7 +69,7 @@ print_help()
#endif
printf(" --repl Start a very simple REPL (read-eval-print-loop) mode\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");
#endif
#if WASM_ENABLE_LIBC_WASI != 0
@ -571,7 +571,7 @@ main(int argc, char *argv[])
#endif
bool is_repl_mode = false;
bool is_xip_file = false;
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
bool disable_bounds_checks = false;
#endif
#if WASM_ENABLE_LIBC_WASI != 0
@ -638,7 +638,7 @@ main(int argc, char *argv[])
else if (!strcmp(argv[0], "--repl")) {
is_repl_mode = true;
}
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
else if (!strcmp(argv[0], "--disable-bounds-checks")) {
disable_bounds_checks = true;
}
@ -886,7 +886,7 @@ main(int argc, char *argv[])
goto fail3;
}
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
#if WASM_CONFIGURABLE_BOUNDS_CHECKS != 0
if (disable_bounds_checks) {
wasm_runtime_set_bounds_checks(wasm_module_inst, false);
}