diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bc6e55b2031..41e01cd367c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-07-20 Pedro Alves + + * cp-support.c (cp_find_first_component_aux): Add missing case for + end of string. + 2017-07-18 David Blaikie * dwarf2read.c (create_cus_hash_table): Re-add lost initialization diff --git a/gdb/cp-support.c b/gdb/cp-support.c index 122faddf35d..df9a563508c 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -1009,6 +1009,8 @@ cp_find_first_component_aux (const char *name, int permissive) ++index; switch (name[index]) { + case '\0': + return index; /* Skip over one less than the appropriate number of characters: the for loop will skip over the last one. */