binutils-gdb/libctf
Nick Alcock 327356780a
libctf: don't leak enums if ctf_add_type fails
If ctf_add_type failed in the middle of enumerator addition, the
destination would end up containing the source enum type and some
but not all of its enumerator constants.

Use snapshots to roll back the enum addition as a whole if this happens.
Before now, it's been pretty unlikely, but in an upcoming commit we will ban
addition of enumerators that already exist in a given dict, making failure
of ctf_add_enumerator and thus of this part of ctf_add_type much more
likely.

libctf/
	* ctf-create.c (ctf_add_type_internal): Roll back if enum or
          enumerator addition fails.
2024-06-18 13:20:31 +01:00
..
doc libctf: doc: fix ctf_stype_t typedef string in spec 2024-06-18 13:20:31 +01:00
testsuite PR 31882 libctf: test suite incorrect format specifiers 2024-06-12 13:16:27 +09:30
.gitignore
aclocal.m4
ChangeLog
ChangeLog-2020
config.h.in
configure
configure.ac autoupdate: add square brackets around arguments of AC_INIT 2024-06-10 08:25:56 +09:30
ctf-archive.c libctf: ctf_archive_iter: fix tiny leak 2024-05-17 12:58:17 +01:00
ctf-create.c libctf: don't leak enums if ctf_add_type fails 2024-06-18 13:20:31 +01:00
ctf-decl.c
ctf-decls.h
ctf-dedup.c libctf: dedup: enums with overlapping enumerators are conflicting 2024-06-18 13:20:31 +01:00
ctf-dump.c
ctf-endian.h
ctf-error.c
ctf-hash.c
ctf-impl.h libctf: dedup: enums with overlapping enumerators are conflicting 2024-06-18 13:20:31 +01:00
ctf-inlines.h
ctf-intl.h
ctf-labels.c
ctf-link.c
ctf-lookup.c
ctf-open-bfd.c
ctf-open.c libctf: fix leak of entire dict when dict opening fails 2024-05-17 12:58:18 +01:00
ctf-qsort_r.c
ctf-serialize.c
ctf-sha1.c
ctf-sha1.h
ctf-string.c libctf: strtab corruption when strings are added to ctf_open()ed dicts 2024-06-18 13:20:31 +01:00
ctf-subr.c libctf: don't pass errno into ctf_err_warn so often 2024-04-19 16:14:48 +01:00
ctf-types.c
ctf-util.c
elf.h
libctf.ver
Makefile.am
Makefile.in
NEWS
swap.h