aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppfiles.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-03-29 19:02:40 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-03-29 19:02:40 +0000
commitc6b5cb46045d1383c60ec58a470a2cfcee4d0441 (patch)
tree1c159b06db3484253989b3e1274c3c1dc123e963 /gcc/cppfiles.c
parentfc9e8a145556a42cff9c98ad30b1c8fda8bbfb44 (diff)
downloadgcc-c6b5cb46045d1383c60ec58a470a2cfcee4d0441.zip
gcc-c6b5cb46045d1383c60ec58a470a2cfcee4d0441.tar.gz
gcc-c6b5cb46045d1383c60ec58a470a2cfcee4d0441.tar.bz2
cppfiles.c (cpp_read_file): Don't pass zero-length string to _cpp_calc_hash.
* cppfiles.c (cpp_read_file): Don't pass zero-length string to _cpp_calc_hash. From-SVN: r32808
Diffstat (limited to 'gcc/cppfiles.c')
-rw-r--r--gcc/cppfiles.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index f46052e..a64307b 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -623,7 +623,11 @@ cpp_read_file (pfile, fname)
fname = "";
dummy.nshort = fname;
- dummy.hash = _cpp_calc_hash (fname, strlen (fname));
+ /* _cpp_calc_hash doesn't like zero-length strings. */
+ if (*fname == 0)
+ dummy.hash = 0;
+ else
+ dummy.hash = _cpp_calc_hash (fname, strlen (fname));
slot = (IHASH **) htab_find_slot_with_hash (pfile->all_include_files,
(const void *) &dummy,
dummy.hash, 1);