summaryrefslogtreecommitdiffstats
path: root/libdw/encoded-value.h
diff options
context:
space:
mode:
authorJosh Stone <[email protected]>2015-02-11 13:53:14 -0800
committerJosh Stone <[email protected]>2015-02-11 15:50:44 -0800
commit031db7ce5f149c8469ac33f688a09ffb15c5d85d (patch)
tree2d1d32b5c0f395bb8015d5a53c03fef41ef1683a /libdw/encoded-value.h
parentb4da85ded5de790aa2cddd6d725970945c97df89 (diff)
libdw: ensure read_encoded_value's value is set
With CFLAGS='-Og -g', F21 gcc hits -Werror=maybe-uninitialized in read_encoded_value at "*result += value". It's fine with -O2/-O0. In particular it seems to care about the __libdw_cfi_read_address_inc calls. By my inspection, the only way those don't set value are for error cases, which will then return immediately. This patch just sets value = 0 to begin with, so gcc is always convinced it's fine. Signed-off-by: Josh Stone <[email protected]>
Diffstat (limited to 'libdw/encoded-value.h')
-rw-r--r--libdw/encoded-value.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libdw/encoded-value.h b/libdw/encoded-value.h
index f953f5ef..0fa20183 100644
--- a/libdw/encoded-value.h
+++ b/libdw/encoded-value.h
@@ -152,7 +152,7 @@ read_encoded_value (const Dwarf_CFI *cache, uint8_t encoding,
return true;
}
- Dwarf_Addr value;
+ Dwarf_Addr value = 0;
const unsigned char *endp = cache->data->d.d_buf + cache->data->d.d_size;
switch (encoding & 0x0f)
{