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]

[commit] event-top.c, display_gdb_prompt, remove superfluous null check


Generally we seem to assume that alloca succeeds.
Besides, we've already dereferenced it by this point.

checked in.

2011-03-01  Michael Snyder  <msnyder@vmware.com>

	* event-top.c (display_gdb_prompt): Remove superfluous null check.

Index: event-top.c
===================================================================
RCS file: /cvs/src/src/gdb/event-top.c,v
retrieving revision 1.75
diff -u -p -u -p -r1.75 event-top.c
--- event-top.c	1 Jan 2011 15:33:03 -0000	1.75
+++ event-top.c	1 Mar 2011 21:08:24 -0000
@@ -312,8 +312,8 @@ display_gdb_prompt (char *new_prompt)
       rl_callback_handler_install (new_prompt, input_handler);
     }
   /* new_prompt at this point can be the top of the stack or the one
-     passed in.  */
-  else if (new_prompt)
+     passed in.  It can't be NULL.  */
+  else
     {
       /* Don't use a _filtered function here.  It causes the assumed
          character position to be off, since the newline we read from

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