+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
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;
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);
}
/* 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,
{
if (**pp != ',')
/* Invalid argument list: no ','. */
- return (struct field *) -1;
+ return NULL;
(*pp)++;
STABS_CONTINUE (pp, objfile);
types[n++] = read_type (pp, objfile);