diff options
| author | Mark Wielaard <[email protected]> | 2013-05-03 11:28:49 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2013-05-05 22:15:13 +0200 |
| commit | 9affad3d2314de1bacbabae453a7261cc02feac4 (patch) | |
| tree | 7fef6e5b20e0fc12e3116a79685ab36184a7b1f5 /libdw/dwarf_getsrclines.c | |
| parent | 904aec2c2f62b729a536c2259274fdd440b0d923 (diff) | |
libdw: dwarf_getsrclines don't set end_sequence when there are no lines.
Some CUs might only have a file list, but no actual source lines in their
statement list. Only set end_sequence at the end of the source lines list
if there are actually lines.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdw/dwarf_getsrclines.c')
| -rw-r--r-- | libdw/dwarf_getsrclines.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libdw/dwarf_getsrclines.c b/libdw/dwarf_getsrclines.c index 5a58b783..fa4dd18c 100644 --- a/libdw/dwarf_getsrclines.c +++ b/libdw/dwarf_getsrclines.c @@ -715,7 +715,8 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines) /* Make sure the highest address for the CU is marked as end_sequence. This is required by the DWARF spec, but some compilers forget and dwfl_module_getsrc depends on it. */ - cu->lines->info[nlinelist - 1].end_sequence = 1; + if (nlinelist > 0) + cu->lines->info[nlinelist - 1].end_sequence = 1; /* Success. */ res = 0; |
