diff --git a/dwarf.c b/dwarf.c index c47b9a6..10aa800 100644 --- a/dwarf.c +++ b/dwarf.c @@ -377,7 +377,12 @@ is followed by a single null byte." */ offset += decode_leb128(p, &dummy); if (dest_files) { - dest_files[nfiles].dir = dest_directories[dir_index - 1]; + if (dir_index) { + dest_files[nfiles].dir = dest_directories[dir_index - 1]; + } else { + /* The current directory of the compilation is understood to be the zeroth entry and is not explicitly represented. */ + dest_files[nfiles].dir = "."; + } } ++nfiles;