This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] event-loop.c (delete_async_signal_handler): Assert prev_ptr.


Joel Brobecker wrote:
2011-03-04 Michael Snyder <msnyder@vmware.com>

* event-loop.c (delete_async_signal_handler): Assert prev_ptr.

This code goes all the way back to 1999, probably version 1.1. I'm really not very familiar with this part of the code, but the assertion seems harmless. I asked myself whether we might want to recover in a little more user-friendly way, by maybe emitting a complaint and behave as if the function was never called. But in the end, for an issue that apparently never really happened in the last 12 years, an assertion seems OK.

Any other thoughts on this patch?

OK, checking this in.


Index: event-loop.c
===================================================================
RCS file: /cvs/src/src/gdb/event-loop.c,v
retrieving revision 1.48
diff -u -p -u -p -r1.48 event-loop.c
--- event-loop.c	5 Jan 2011 22:22:48 -0000	1.48
+++ event-loop.c	4 Mar 2011 22:52:02 -0000
@@ -1077,6 +1077,7 @@ delete_async_signal_handler (async_signa
       prev_ptr = sighandler_list.first_handler;
       while (prev_ptr && prev_ptr->next_handler != (*async_handler_ptr))
 	prev_ptr = prev_ptr->next_handler;
+      gdb_assert (prev_ptr);
       prev_ptr->next_handler = (*async_handler_ptr)->next_handler;
       if (sighandler_list.last_handler == (*async_handler_ptr))
 	sighandler_list.last_handler = prev_ptr;




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]