aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/c-exp.y5
2 files changed, 9 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6ca534a..57c7588 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2019-01-06 Tom Tromey <tom@tromey.com>
+ * c-exp.y (struct c_parse_state) <strings>: New member.
+ (operator_stoken): Update.
+
+2019-01-06 Tom Tromey <tom@tromey.com>
+
* parser-defs.h (type_ptr): Remove typedef. Don't declare VEC.
(union type_stack_elt) <typelist_val>: Now a pointer to
std::vector.
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 54eb389..10e4ada 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -74,6 +74,9 @@ struct c_parse_state
allocated during the parse. */
std::vector<std::unique_ptr<std::vector<struct type *>>> type_lists;
std::vector<std::unique_ptr<struct type_stack>> type_stacks;
+
+ /* Storage for some strings allocated during the parse. */
+ std::vector<gdb::unique_xmalloc_ptr<char>> strings;
};
/* This is set and cleared in c_parse. */
@@ -1743,7 +1746,7 @@ operator_stoken (const char *op)
st.ptr = buf;
/* The toplevel (c_parse) will free the memory allocated here. */
- make_cleanup (free, buf);
+ cpstate->strings.emplace_back (buf);
return st;
};