While digging into a different memory corruption error, I happened to
notice one coming from the linetable code. In a couple of spots, the
wrong termination condition was used in a loop, leading gdb to read
one element past the end of the linetable.
Built and regtested on x86-64 Fedora 18. Also verified using
valgrind. I'm checking this in.
2013-11-14 Tom Tromey <tromey@redhat.com>
* python/py-linetable.c (ltpy_has_line)
(ltpy_get_all_source_lines): Fix loop termination condition.
+2013-11-14 Tom Tromey <tromey@redhat.com>
+
+ * python/py-linetable.c (ltpy_has_line)
+ (ltpy_get_all_source_lines): Fix loop termination condition.
+
2013-11-14 Joel Brobecker <brobecker@adacore.com>
* mi/mi-parse.h (struct mi_parse) <language>: New field.
return NULL;
}
- for (index = 0; index <= LINETABLE (symtab)->nitems; index++)
+ for (index = 0; index < LINETABLE (symtab)->nitems; index++)
{
struct linetable_entry *item = &(symtab->linetable->item[index]);
if (item->line == py_line)
if (source_dict == NULL)
return NULL;
- for (index = 0; index <= LINETABLE (symtab)->nitems; index++)
+ for (index = 0; index < LINETABLE (symtab)->nitems; index++)
{
item = &(LINETABLE (symtab)->item[index]);