mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-19 16:11:33 +00:00
fix: handle null exec_env in instruction metering checks
This commit is contained in:
parent
ad6ba3d7cf
commit
76392b546b
|
@ -1623,7 +1623,10 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||||
uint32 cache_index, type_index, param_cell_num, cell_num;
|
uint32 cache_index, type_index, param_cell_num, cell_num;
|
||||||
|
|
||||||
#if WASM_INSTRUCTION_METERING != 0
|
#if WASM_INSTRUCTION_METERING != 0
|
||||||
int instructions_left = exec_env->instructions_to_execute;
|
int instructions_left = -1;
|
||||||
|
if (exec_env) {
|
||||||
|
instructions_left = exec_env->instructions_to_execute;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if WASM_ENABLE_EXCE_HANDLING != 0
|
#if WASM_ENABLE_EXCE_HANDLING != 0
|
||||||
|
|
|
@ -1524,7 +1524,10 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||||
uint8 opcode = 0, local_type, *global_addr;
|
uint8 opcode = 0, local_type, *global_addr;
|
||||||
|
|
||||||
#if WASM_INSTRUCTION_METERING != 0
|
#if WASM_INSTRUCTION_METERING != 0
|
||||||
int instructions_left = exec_env->instructions_to_execute;
|
int instructions_left = -1;
|
||||||
|
if (exec_env) {
|
||||||
|
instructions_left = exec_env->instructions_to_execute;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user