Commit c6b5cb46 by Zack Weinberg Committed by Zack Weinberg

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
parent fc9e8a14
2000-03-29 Zack Weinberg <zack@wolery.cumb.org>
* cppfiles.c (cpp_read_file): Don't pass zero-length string to
_cpp_calc_hash.
2000-03-29 Jakub Jelinek <jakub@redhat.com> 2000-03-29 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (gen_enumeration_type_die): If enum has a negative * dwarf2out.c (gen_enumeration_type_die): If enum has a negative
......
...@@ -623,7 +623,11 @@ cpp_read_file (pfile, fname) ...@@ -623,7 +623,11 @@ cpp_read_file (pfile, fname)
fname = ""; fname = "";
dummy.nshort = 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, slot = (IHASH **) htab_find_slot_with_hash (pfile->all_include_files,
(const void *) &dummy, (const void *) &dummy,
dummy.hash, 1); dummy.hash, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment