diff options
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/dwarf-index-write.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 126deb7..0e5a3f4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-10-04 Simon Marchi <simon.marchi@ericsson.com> + + * dwarf-index-write.c (file_write): Don't write if the vector is + empty. + 2018-10-05 Tom de Vries <tdevries@suse.de> * python/py-progspace.c (pspy_solib_name): Fix type mismatch in diff --git a/gdb/dwarf-index-write.c b/gdb/dwarf-index-write.c index 2520321..d4585af 100644 --- a/gdb/dwarf-index-write.c +++ b/gdb/dwarf-index-write.c @@ -80,7 +80,8 @@ template<typename Elem, typename Alloc> static void file_write (FILE *file, const std::vector<Elem, Alloc> &vec) { - file_write (file, vec.data (), vec.size () * sizeof (vec[0])); + if (!vec.empty ()) + file_write (file, vec.data (), vec.size () * sizeof (vec[0])); } /* In-memory buffer to prepare data to be written later to a file. */ |