* config/pa/linux.mh (XDEPFILES): Remove.
[binutils-gdb.git] / gdb / parse.c
index 8762ccac622f20e99ecb82cbd518ff00ceb135f2..eee1f8e7fd34c426e0b60faaac831ccfd99ae57e 100644 (file)
@@ -1,7 +1,7 @@
 /* Parse expressions for GDB.
 
    Copyright (C) 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001, 2004, 2005, 2007, 2008
+   1998, 1999, 2000, 2001, 2004, 2005, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
    Modified from expread.y by the Department of Computer Science at the
@@ -1090,7 +1090,8 @@ parse_expression (char *string)
 /* Parse STRING as an expression.  If parsing ends in the middle of a
    field reference, return the type of the left-hand-side of the
    reference; furthermore, if the parsing ends in the field name,
-   return the field name in *NAME.  In all other cases, return NULL.  */
+   return the field name in *NAME.  In all other cases, return NULL.
+   Returned non-NULL *NAME must be freed by the caller.  */
 
 struct type *
 parse_field_expression (char *string, char **name)
@@ -1120,6 +1121,9 @@ parse_field_expression (char *string, char **name)
       xfree (exp);
       return NULL;
     }
+  /* (*NAME) is a part of the EXP memory block freed below.  */
+  *name = xstrdup (*name);
+
   val = evaluate_subexpression_type (exp, subexp);
   xfree (exp);
 
@@ -1268,8 +1272,7 @@ follow_types (struct type *follow_type)
          create_array_type ((struct type *) NULL,
                             follow_type, range_type);
        if (array_size < 0)
-         TYPE_ARRAY_UPPER_BOUND_TYPE (follow_type)
-           = BOUND_CANNOT_BE_DETERMINED;
+         TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (follow_type) = 1;
        break;
       case tp_function:
        /* FIXME-type-allocation: need a way to free this type when we are