From 194ef23d1c94f1fb7d6860dcc8ddbb5a4d68d122 Mon Sep 17 00:00:00 2001 From: tracer-ics2023 Date: Sun, 1 Sep 2024 16:44:03 +0800 Subject: [PATCH] =?UTF-8?q?>=20=20compile=20NEMU=20221220000=20=E5=BC=A0?= =?UTF-8?q?=E4=B8=89=20Linux=20zzy=205.15.146.1-microsoft-standard-WSL2=20?= =?UTF-8?q?#1=20SMP=20Thu=20Jan=2011=2004:09:03=20UTC=202024=20x86=5F64=20?= =?UTF-8?q?x86=5F64=20x86=5F64=20GNU/Linux=20=2016:44:03=20up=201=20day,?= =?UTF-8?q?=2015:34,=20=201=20user,=20=20load=20average:=200.26,=200.21,?= =?UTF-8?q?=200.20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nemu/src/monitor/sdb/watchpoint.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nemu/src/monitor/sdb/watchpoint.c b/nemu/src/monitor/sdb/watchpoint.c index d283a7d..103809d 100644 --- a/nemu/src/monitor/sdb/watchpoint.c +++ b/nemu/src/monitor/sdb/watchpoint.c @@ -62,7 +62,7 @@ bool wp_check_hit(void) { } static WP* del_wp(WP** head, WP* pos) { - for (WP** i = head; (*i) != NULL && (*i)->next != NULL; i = (WP**)*i) { + for (WP** i = head; (*i) != NULL; i = (WP**)*i) { if ((**i).NO == pos->NO) { WP* res = *i; *i = (*i)->next; @@ -112,6 +112,7 @@ void free_wp(WP *_wp) { WP* wp = del_wp(&head, _wp); if (wp == NULL) { printf("free_wp: no such watchpoint\n"); + return; } wp->next = free_; free_ = wp;