diff options
author | Ian Lance Taylor <iant@google.com> | 2012-11-20 17:28:05 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-11-20 17:28:05 +0000 |
commit | b20ade36e40a97f2836926dd95cbb5a7d087f58f (patch) | |
tree | 5d9cd4197f022cb233bb0c912c217f3dcc0bb7b2 /libbacktrace | |
parent | 03367cbbae393715e19009845be491dda3e72adb (diff) | |
download | gcc-b20ade36e40a97f2836926dd95cbb5a7d087f58f.tar.gz |
* dwarf.c (read_attribute): Always clear val.
From-SVN: r193670
Diffstat (limited to 'libbacktrace')
-rw-r--r-- | libbacktrace/ChangeLog | 4 | ||||
-rw-r--r-- | libbacktrace/dwarf.c | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog index fc5871ad30d..7d2cfda88b9 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 b198dea38dc..bd7419b9c9a 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: |