This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] rbreak_command, move variable to outer scope.
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Sun, 27 Feb 2011 14:12:42 -0800
- Subject: [commit] rbreak_command, move variable to outer scope.
A pointer to this variable is used in the outer scope, after the
variable itself has gone out of scope.
2011-02-27 Michael Snyder <msnyder@vmware.com>
* symtab.c (rbreak_command): Move variable 'file_name' to
outer scope.
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.258
diff -u -p -u -p -r1.258 symtab.c
--- symtab.c 13 Feb 2011 09:09:36 -0000 1.258
+++ symtab.c 27 Feb 2011 22:09:21 -0000
@@ -3403,7 +3403,7 @@ rbreak_command (char *regexp, int from_t
struct cleanup *old_chain;
char *string = NULL;
int len = 0;
- char **files = NULL;
+ char **files = NULL, *file_name;
int nfiles = 0;
if (regexp)
@@ -3413,7 +3413,6 @@ rbreak_command (char *regexp, int from_t
if (colon && *(colon + 1) != ':')
{
int colon_index;
- char * file_name;
colon_index = colon - regexp;
file_name = alloca (colon_index + 1);