diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog index fc5871ad30dedb98c56549c1aec60d3f7d3552e1..7d2cfda88b9c7f59ac42b731bac1e49032099849 100644 --- a/libbacktrace/ChangeLog +++ b/libbacktrace/ChangeLog @@ -1,3 +1,7 @@ +2012-11-20 Ian Lance Taylor <iant@google.com> + + * dwarf.c (read_attribute): Always clear val. + 2012-11-13 Ian Lance Taylor <iant@google.com> PR other/55312 diff --git a/libbacktrace/dwarf.c b/libbacktrace/dwarf.c index b198dea38dc8ddfcda8b782a981dc31830491bc0..bd7419b9c9af08e45031b577a7a5a6ba79879c11 100644 --- a/libbacktrace/dwarf.c +++ b/libbacktrace/dwarf.c @@ -654,6 +654,12 @@ read_attribute (enum dwarf_form form, struct dwarf_buf *buf, const unsigned char *dwarf_str, size_t dwarf_str_size, struct attr_val *val) { + /* Avoid warnings about val.u.FIELD may be used uninitialized if + this function is inlined. The warnings aren't valid but can + occur because the different fields are set and used + conditionally. */ + memset (val, 0, sizeof *val); + switch (form) { case DW_FORM_addr: