This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 1/2] Fix the unitialized bit in a struct field corresponding to enumb
- From: Maxim Akhmedov <max42 at yandex-team dot com>
- To: gdb-patches at sourceware dot org
- Date: Sat, 11 Feb 2017 18:23:58 +0300
- Subject: [PATCH 1/2] Fix the unitialized bit in a struct field corresponding to enumb
- Authentication-results: sourceware.org; auth=none
- Authentication-results: mxbackcorp1g.mail.yandex.net; dkim=pass header.i=@yandex-team.com
- Envelope-from: max42 at yandex-team dot ru
Without setting this bit, even for a small enumeration types their member fields contain random 0/1's as the values of "artificial". When comparing two instances of exactly the same
enum type, the result depends on whether their members contain the same garbage as the value of artificial.
gdb/ChangeLog:
2017-02-11 Maxim Akhmedov <max42@yandex-team.ru>
* dwarf2read.c: fix uninitialized bit in a struct field corresponding
to enumeration member.
---
gdb/dwarf2read.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 774ed73075..676da14c58 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -13652,6 +13652,7 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu)
FIELD_TYPE (fields[num_fields]) = NULL;
SET_FIELD_ENUMVAL (fields[num_fields], SYMBOL_VALUE (sym));
FIELD_BITSIZE (fields[num_fields]) = 0;
+ FIELD_ARTIFICIAL (fields[num_fields]) = 0;
num_fields++;
}
--
2.11.0