From 4d0f5cfade9549ef3c9459e4f3e5b6226f3c1ffa Mon Sep 17 00:00:00 2001 From: Callum Macmillan Date: Tue, 13 Dec 2022 07:16:43 +0000 Subject: [PATCH] Fix watchpoint segfault when using debug interp without server (#1806) --- core/iwasm/interpreter/wasm_interp_classic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/iwasm/interpreter/wasm_interp_classic.c b/core/iwasm/interpreter/wasm_interp_classic.c index 54fcf8d0b..5fe814384 100644 --- a/core/iwasm/interpreter/wasm_interp_classic.c +++ b/core/iwasm/interpreter/wasm_interp_classic.c @@ -1157,8 +1157,10 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, #if WASM_ENABLE_DEBUG_INTERP != 0 uint8 *frame_ip_orig = NULL; WASMDebugInstance *debug_instance = wasm_exec_env_get_instance(exec_env); - bh_list *watch_point_list_read = &debug_instance->watch_point_list_read; - bh_list *watch_point_list_write = &debug_instance->watch_point_list_write; + bh_list *watch_point_list_read = + debug_instance ? &debug_instance->watch_point_list_read : NULL; + bh_list *watch_point_list_write = + debug_instance ? &debug_instance->watch_point_list_write : NULL; #endif #if WASM_ENABLE_LABELS_AS_VALUES != 0