diff options
| author | Petr Machata <[email protected]> | 2018-01-14 03:22:05 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2018-01-14 17:28:43 +0100 |
| commit | 1e2c886bb2e1e48dfc592f356ecad7da0a032f0a (patch) | |
| tree | 815b0b8f59d2b51db89871246d6fd17bcbbdac55 /tests/arls.c | |
| parent | c09d611f823c8a6ddb8513fd1113b1ced61baf6c (diff) | |
libdw: dwarf_formsdata should return a signed value
The function dwarf_formsdata is used for decoding signed values, but
except for the variable-length DW_FORM_sdata, it uses unsigned
primitives to decode the value. This is not a problem for 64-bit values,
but the smaller values come decoded wrong. Fix by changing to signed
primitives for decoding the fixed-length forms.
Add a test case that uses dwarf_aggregate_size to determine an array
size whose lower bound is -1, encoded using DW_FORM_data1, and upper
bound 255 with DW_FORM_data2. When the -1 is decoded wrongly, it comes
back as 255, and the array size is 1. The correct array size should be
257.
Signed-off-by: Petr Machata <[email protected]>
Diffstat (limited to 'tests/arls.c')
0 files changed, 0 insertions, 0 deletions
