mirror of
https://github.com/openharmony/third_party_elfutils.git
synced 2026-07-19 19:43:34 -04:00
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 <jistone@redhat.com>
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2015-02-11 Josh Stone <jistone@redhat.com>
|
||||
|
||||
* encoded-value.h (read_encoded_value): Initialize value.
|
||||
|
||||
2015-02-11 Petr Machata <pmachata@redhat.com>
|
||||
|
||||
* dwarf_ranges.c (dwarf_ranges): Do not bail out when neither
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user