aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/inferior.c10
2 files changed, 8 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c6f7909..5e4b9f1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2019-12-05 Philippe Waroquiers <philippe.waroquiers@skynet.be>
+ * inferior.c (prune_inferiors): Only call delete_inferior,
+ Do not modify the inferior list.
+
2019-12-05 Simon Marchi <simon.marchi@polymtl.ca>
* c-exp.y: Update calls to lookup_typename,
diff --git a/gdb/inferior.c b/gdb/inferior.c
index 84e4d24..87df193 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -370,24 +370,22 @@ have_live_inferiors (void)
void
prune_inferiors (void)
{
- struct inferior *ss, **ss_link;
+ inferior *ss;
ss = inferior_list;
- ss_link = &inferior_list;
while (ss)
{
if (!ss->deletable ()
|| !ss->removable
|| ss->pid != 0)
{
- ss_link = &ss->next;
- ss = *ss_link;
+ ss = ss->next;
continue;
}
- *ss_link = ss->next;
+ inferior *ss_next = ss->next;
delete_inferior (ss);
- ss = *ss_link;
+ ss = ss_next;
}
}