[RFA 13/22] Remove unnecessary cleanup from stabsread.c

Tom Tromey
2016-09-27T04:51:26Z

This removes an unnecessary cleanup from stabsread.c. It's
unnecessary because nothing between the cleanup creation and use makes
a cleanup.

2016-09-26 Tom Tromey <tom@tromey.com>

* stabsread.c (read_struct_type): Remove unnecessary cleanup.
---
gdb/ChangeLog | 4 ++++
gdb/stabsread.c | 9 +--------
2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d3b8a45..476dbb3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2016-09-26 Tom Tromey <tom@tromey.com>

+ * stabsread.c (read_struct_type): Remove unnecessary cleanup.
+
+2016-09-26 Tom Tromey <tom@tromey.com>
+
* tracepoint.c (trace_dump_command): Remove unnecessary
null_cleanup.

diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index e8ebadd..cc2fef3 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -3507,7 +3507,6 @@ static struct type *
read_struct_type (char **pp, struct type *type, enum type_code type_code,
struct objfile *objfile)
{
- struct cleanup *back_to;
struct field_info fi;

fi.list = NULL;
@@ -3533,8 +3532,6 @@ read_struct_type (char **pp, struct type *type, enum type_code type_code,
return type;
}

- back_to = make_cleanup (null_cleanup, 0);
-
INIT_CPLUS_SPECIFIC (type);
TYPE_CODE (type) = type_code;
TYPE_STUB (type) = 0;
@@ -3546,10 +3543,7 @@ read_struct_type (char **pp, struct type *type, enum type_code type_code,

TYPE_LENGTH (type) = read_huge_number (pp, 0, &nbits, 0);
if (nbits != 0)
- {
- do_cleanups (back_to);
- return error_type (pp, objfile);
- }
+ return error_type (pp, objfile);
set_length_in_type_chain (type);
}

@@ -3568,7 +3562,6 @@ read_struct_type (char **pp, struct type *type, enum type_code type_code,
type = error_type (pp, objfile);
}

- do_cleanups (back_to);
return (type);
}

--
2.7.4