[RFA 16/42] Use gdb_assert in two places in buildsym.c

Tom Tromey
2018-05-23T04:59:12Z

This changes buildsym.c to use gdb_assert rather than internal_error
in a couple of spots.

gdb/ChangeLog
2018-05-22 Tom Tromey <tom@tromey.com>

* buildsym.c (push_subfile): Use gdb_assert.
(pop_subfile): Use gdb_assert.
---
gdb/ChangeLog | 5 +++++
gdb/buildsym.c | 12 ++----------
2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 4744d510c3..4823fb383d 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -896,11 +896,7 @@ push_subfile (void)

tem->next = subfile_stack;
subfile_stack = tem;
- if (current_subfile == NULL || current_subfile->name == NULL)
- {
- internal_error (__FILE__, __LINE__,
- _("failed internal consistency check"));
- }
+ gdb_assert (! (current_subfile == NULL || current_subfile->name == NULL));
tem->name = current_subfile->name;
}

@@ -910,11 +906,7 @@ pop_subfile (void)
char *name;
struct subfile_stack *link = subfile_stack;

- if (link == NULL)
- {
- internal_error (__FILE__, __LINE__,
- _("failed internal consistency check"));
- }
+ gdb_assert (link != NULL);
name = link->name;
subfile_stack = link->next;
xfree ((void *) link);
--
2.13.6