aboutsummaryrefslogtreecommitdiff
path: root/binutils/ieee.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-01-24 21:10:55 +0000
committerIan Lance Taylor <ian@airs.com>1996-01-24 21:10:55 +0000
commit76e45938c3dbf2a25eb273bfcd3aa4961585dd5e (patch)
treeda030b5d4faecd6c7320064fc971ab6d31e1f7bc /binutils/ieee.c
parent397a4fa366643d3813beac4720a5f5552261bdba (diff)
downloadgdb-76e45938c3dbf2a25eb273bfcd3aa4961585dd5e.zip
gdb-76e45938c3dbf2a25eb273bfcd3aa4961585dd5e.tar.gz
gdb-76e45938c3dbf2a25eb273bfcd3aa4961585dd5e.tar.bz2
* ieee.c (ieee_define_named_type): When creating a tag for an
anonymous struct, copy the name into memory. (ieee_tag_type): Likewise. * debug.c (debug_write_type): Only check and set id field for an unnamed object. (debug_write_class_type): Likewise.
Diffstat (limited to 'binutils/ieee.c')
-rw-r--r--binutils/ieee.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/binutils/ieee.c b/binutils/ieee.c
index 6b40985..9539320 100644
--- a/binutils/ieee.c
+++ b/binutils/ieee.c
@@ -4190,6 +4190,8 @@ ieee_define_named_type (info, name, tagp, id, size, unsignedp, ppbuf)
{
nt = (struct ieee_name_type *) xmalloc (sizeof *nt);
memset (nt, 0, sizeof *nt);
+ if (tag != name)
+ tag = xstrdup (ab);
nt->name = tag;
nt->next = info->tags;
info->tags = nt;
@@ -5701,6 +5703,8 @@ ieee_tag_type (p, name, id, kind)
nt = (struct ieee_name_type *) xmalloc (sizeof *nt);
memset (nt, 0, sizeof *nt);
+ if (name == ab)
+ name = xstrdup (ab);
nt->name = name;
nt->type.indx = info->type_indx;
++info->type_indx;