From: Tom Tromey Date: Thu, 3 Jan 2019 02:13:15 +0000 (-0700) Subject: Remove string-related cleanup from c-exp.y X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c65bac3846567a8068fe4aa5cfa79da5b193a1af;p=binutils-gdb.git Remove string-related cleanup from c-exp.y This removes a string-related cleanup from c-exp.y, by adding a new member to c_parse_state to store the strings. gdb/ChangeLog 2019-01-06 Tom Tromey * c-exp.y (struct c_parse_state) : New member. (operator_stoken): Update. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6ca534a0d24..57c75880753 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-01-06 Tom Tromey + + * c-exp.y (struct c_parse_state) : New member. + (operator_stoken): Update. + 2019-01-06 Tom Tromey * parser-defs.h (type_ptr): Remove typedef. Don't declare VEC. diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 54eb38935bd..10e4ada5f04 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>> type_lists; std::vector> type_stacks; + + /* Storage for some strings allocated during the parse. */ + std::vector> 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; };