summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2006-01-15 20:26:02 +0000
committerDaniel Jacobowitz <dan@debian.org>2006-01-15 20:26:02 +0000
commit25670cc8bf2bcf7a9009e0164c581cd6a2acd36e (patch)
tree03657c86fdc97471dce107295c9c4a9e79b090a7
parent47707d0114078e118e1c2123d6f83f7af508db16 (diff)
downloadgdb-25670cc8bf2bcf7a9009e0164c581cd6a2acd36e.tar.gz
* macroexp.c (expand): Initialize argc.
* stabsread.c (read_type): Handle errors from read_args. (read_args): Return NULL for errors.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/macroexp.c2
-rw-r--r--gdb/stabsread.c8
3 files changed, 12 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cd0d085d866..24d93f1cbdf 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2006-01-15 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * macroexp.c (expand): Initialize argc.
+ * stabsread.c (read_type): Handle errors from read_args.
+ (read_args): Return NULL for errors.
+
2006-01-15 Mark Kettenis <kettenis@gnu.org>
* osabi.c (generic_elf_osabi_sniffer): Use memcmp instead of
diff --git a/gdb/macroexp.c b/gdb/macroexp.c
index f5dc40c0cab..a7ca6e04eca 100644
--- a/gdb/macroexp.c
+++ b/gdb/macroexp.c
@@ -927,7 +927,7 @@ expand (const char *id,
else if (def->kind == macro_function_like)
{
struct cleanup *back_to = make_cleanup (null_cleanup, 0);
- int argc;
+ int argc = 0;
struct macro_buffer *argv = NULL;
struct macro_buffer substituted;
struct macro_buffer substituted_src;
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index bbaa40d762f..e346ad285fd 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -1804,6 +1804,8 @@ again:
return_type = read_type (pp, objfile);
args = read_args (pp, ';', objfile, &nargs, &varargs);
+ if (args == NULL)
+ return error_type (pp, objfile);
type = dbx_alloc_type (typenums, objfile);
smash_to_method_type (type, domain, return_type, args,
nargs, varargs);
@@ -3985,8 +3987,8 @@ handle_true_range:
}
/* Read in an argument list. This is a list of types, separated by commas
- and terminated with END. Return the list of types read in, or (struct type
- **)-1 if there is an error. */
+ and terminated with END. Return the list of types read in, or NULL
+ if there is an error. */
static struct field *
read_args (char **pp, int end, struct objfile *objfile, int *nargsp,
@@ -4001,7 +4003,7 @@ read_args (char **pp, int end, struct objfile *objfile, int *nargsp,
{
if (**pp != ',')
/* Invalid argument list: no ','. */
- return (struct field *) -1;
+ return NULL;
(*pp)++;
STABS_CONTINUE (pp, objfile);
types[n++] = read_type (pp, objfile);