Skip to content

Commit ca0b5cf

Browse files
authored
Fix watchpoint segfault when using debug interp without server (#1806)
1 parent 294a625 commit ca0b5cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/iwasm/interpreter/wasm_interp_classic.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,8 +1157,10 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
11571157
#if WASM_ENABLE_DEBUG_INTERP != 0
11581158
uint8 *frame_ip_orig = NULL;
11591159
WASMDebugInstance *debug_instance = wasm_exec_env_get_instance(exec_env);
1160-
bh_list *watch_point_list_read = &debug_instance->watch_point_list_read;
1161-
bh_list *watch_point_list_write = &debug_instance->watch_point_list_write;
1160+
bh_list *watch_point_list_read =
1161+
debug_instance ? &debug_instance->watch_point_list_read : NULL;
1162+
bh_list *watch_point_list_write =
1163+
debug_instance ? &debug_instance->watch_point_list_write : NULL;
11621164
#endif
11631165

11641166
#if WASM_ENABLE_LABELS_AS_VALUES != 0

0 commit comments

Comments
 (0)