+2016-02-13 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf_getsrclines.c (read_srclines): Calculate ndirs first, then
+ assign to ndirlist.
+
2015-12-18 Mark Wielaard <mjw@redhat.com>
* libdwP.h (struct Dwarf): Remove sectiondata_gzip_mask.
/* Return line number information of CU.
- Copyright (C) 2004-2010, 2013, 2014, 2015 Red Hat, Inc.
+ Copyright (C) 2004-2010, 2013, 2014, 2015, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2004.
/* First count the entries. */
const unsigned char *dirp = linep;
+ unsigned int ndirs = 0;
while (*dirp != 0)
{
uint8_t *endp = memchr (dirp, '\0', lineendp - dirp);
if (endp == NULL)
goto invalid_data;
- ++ndirlist;
+ ++ndirs;
dirp = endp + 1;
}
+ ndirlist += ndirs;
/* Arrange the list in array form. */
if (ndirlist >= MAX_STACK_DIRS)