8sa1-binutils-gdb/gdb/python
Keith Seitz 59ecaff361 Initialize `location' in gdbpy_decode_line
BuildBot flagged an uninitialized variable coming from one of the patches
in my recently committed locations/explicit patchset.

The following patch fixes this.

gdb/ChangeLog

	* python/python.c (gdbpy_decode_line): Initialize `location' to NULL
	and only call decode_line_1 when it is non-NULL.

diff --git a/gdb/python/python.c b/gdb/python/python.c
index c28f98b..14da62c 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -730,7 +730,7 @@ gdbpy_decode_line (PyObject *self, PyObject *args)
   PyObject *result = NULL;
   PyObject *return_result = NULL;
   PyObject *unparsed = NULL;
-  struct event_location *location;
+  struct event_location *location = NULL;

   if (! PyArg_ParseTuple (args, "|s", &arg))
     return NULL;
@@ -747,7 +747,7 @@ gdbpy_decode_line (PyObject *self, PyObject *args)

   TRY
     {
-      if (arg)
+      if (location != NULL)
 	sals = decode_line_1 (location, 0, 0, 0);
       else
 	{
2015-08-12 11:31:24 -07:00
..
lib/gdb PR python/17136 2015-08-06 09:24:58 -07:00
py-arch.c
py-auto-load.c
py-block.c
py-bpevent.c
py-breakpoint.c Explicit locations: use new location API 2015-08-11 17:09:35 -07:00
py-cmd.c Remove --xdb 2015-04-11 19:49:03 +02:00
py-continueevent.c
py-event.c
py-event.h
py-events.h
py-evtregistry.c
py-evts.c
py-exitedevent.c
py-finishbreakpoint.c Explicit locations: introduce address locations 2015-08-11 17:09:35 -07:00
py-frame.c Add casts for legitimate integer to enum conversions 2015-08-06 17:22:49 -04:00
py-framefilter.c
py-function.c
py-gdb-readline.c
py-inferior.c
py-infevents.c
py-infthread.c
py-lazy-string.c PR python/18438 2015-05-26 16:13:04 -07:00
py-linetable.c python: fix Linetable case to LineTable in docstrings and comments 2015-08-04 09:50:53 -07:00
py-newobjfileevent.c
py-objfile.c Allow gdb to find debug symbols file by build-id for PE file format also 2015-06-15 12:10:55 +01:00
py-param.c
py-prettyprint.c PR python/18089 2015-04-28 21:53:54 -07:00
py-progspace.c
py-signalevent.c
py-stopevent.c
py-stopevent.h
py-symbol.c Add casts for legitimate integer to enum conversions 2015-08-06 17:22:49 -04:00
py-symtab.c python: fix Linetable case to LineTable in docstrings and comments 2015-08-04 09:50:53 -07:00
py-threadevent.c
py-type.c Remove CHECK_TYPEDEF, use check_typedef instead 2015-07-14 16:42:16 -04:00
py-unwind.c Fix a couple C++ build issues 2015-05-15 16:00:40 +01:00
py-utils.c
py-value.c Remove CHECK_TYPEDEF, use check_typedef instead 2015-07-14 16:42:16 -04:00
py-varobj.c
py-xmethods.c PR python/18285 2015-04-29 13:24:21 -07:00
python-config.py
python-internal.h Remove redundant include directives. 2015-06-24 13:52:29 +01:00
python.c Initialize `location' in gdbpy_decode_line 2015-08-12 11:31:24 -07:00
python.h