diff options
Diffstat (limited to 'gdb/objc-lang.c')
-rw-r--r-- | gdb/objc-lang.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 77a61ac..5c72340 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -1056,6 +1056,11 @@ uniquify_strings (VEC (const_char_ptr) **strings) const char *elem, *last = NULL; int out; + /* If the vector is empty, there's nothing to do. This explicit + check is needed to avoid invoking qsort with NULL. */ + if (VEC_empty (const_char_ptr, *strings)) + return; + qsort (VEC_address (const_char_ptr, *strings), VEC_length (const_char_ptr, *strings), sizeof (const_char_ptr), |