]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use gdb_assert in two places in buildsym.c
authorTom Tromey <tom@tromey.com>
Sun, 20 May 2018 22:15:14 +0000 (16:15 -0600)
committerTom Tromey <tom@tromey.com>
Mon, 16 Jul 2018 14:55:20 +0000 (08:55 -0600)
This changes buildsym.c to use gdb_assert rather than internal_error
in a couple of spots.

gdb/ChangeLog
2018-07-16  Tom Tromey  <tom@tromey.com>

* buildsym.c (push_subfile): Use gdb_assert.
(pop_subfile): Use gdb_assert.

gdb/ChangeLog
gdb/buildsym.c

index 04b80ebac05392a4d8e8cc4e4632174c024bf1c1..d382384415a30f528a9fba3c0aacac11f4f08954 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-16  Tom Tromey  <tom@tromey.com>
+
+       * buildsym.c (push_subfile): Use gdb_assert.
+       (pop_subfile): Use gdb_assert.
+
 2018-07-16  Tom Tromey  <tom@tromey.com>
 
        * buildsym.h (merge_symbol_lists): Remove.
index d1e47c3eeef1659c65d6a7476d8b63e8491bf8ac..6db07ceb4d45f52b519b5c7be45594c80413bc4b 100644 (file)
@@ -891,11 +891,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;
 }
 
@@ -905,11 +901,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);