re PR preprocessor/16366 (Preprocessor option -remap causes memory corruption)
authorAndris Pavenis <pavenis@latnet.lv>
Fri, 16 Jul 2004 17:07:01 +0000 (20:07 +0300)
committerZack Weinberg <zack@gcc.gnu.org>
Fri, 16 Jul 2004 17:07:01 +0000 (17:07 +0000)
2004-07-16  Andris Pavenis  <pavenis@latnet.lv>

PR preprocessor/16366
* internal.h (struct cpp_reader): New field dir_hash.
* files.c (make_cpp_dir): Use dir_hash, not file_hash.
(_cpp_init_files, _cpp_cleanup_files): Update for new field.

From-SVN: r84821

libcpp/ChangeLog
libcpp/files.c
libcpp/internal.h

index 2cdd78445b88340cf64ce9d3b4a1ac0644592932..48fdf38691b49634af5ae6927f1ab6a41ec85091 100644 (file)
@@ -1,3 +1,10 @@
+2004-07-16  Andris Pavenis  <pavenis@latnet.lv>
+
+       PR preprocessor/16366
+       * internal.h (struct cpp_reader): New field dir_hash.
+       * files.c (make_cpp_dir): Use dir_hash, not file_hash.
+       (_cpp_init_files, _cpp_cleanup_files): Update for new field.
+
 2004-07-04  Neil Booth  <neil@duron.akihabara.co.uk>
 
        PR preprocessor/16192
index cd8d077ef71f294ba5bdc1be7cc18ae82b734f82..fc1fa2c7f0e6a530712516bf66229952a948fd19 100644 (file)
@@ -884,7 +884,7 @@ make_cpp_dir (cpp_reader *pfile, const char *dir_name, int sysp)
   cpp_dir *dir;
 
   hash_slot = (struct file_hash_entry **)
-    htab_find_slot_with_hash (pfile->file_hash, dir_name,
+    htab_find_slot_with_hash (pfile->dir_hash, dir_name,
                              htab_hash_string (dir_name),
                              INSERT);
 
@@ -984,6 +984,8 @@ _cpp_init_files (cpp_reader *pfile)
 {
   pfile->file_hash = htab_create_alloc (127, file_hash_hash, file_hash_eq,
                                        NULL, xcalloc, free);
+  pfile->dir_hash = htab_create_alloc (127, file_hash_hash, file_hash_eq,
+                                       NULL, xcalloc, free);
   allocate_file_hash_entries (pfile);
 }
 
@@ -992,6 +994,7 @@ void
 _cpp_cleanup_files (cpp_reader *pfile)
 {
   htab_delete (pfile->file_hash);
+  htab_delete (pfile->dir_hash);
 }
 
 /* Enter a file name in the hash for the sake of cpp_included.  */
index 845f1ebdf0842ce09746c3a2b6ee9e2792afed2c..0a7eb109187fe32cf21ff163b712fb7c4bb27235 100644 (file)
@@ -334,6 +334,7 @@ struct cpp_reader
 
   /* File and directory hash table.  */
   struct htab *file_hash;
+  struct htab *dir_hash;
   struct file_hash_entry *file_hash_entries;
   unsigned int file_hash_entries_allocated, file_hash_entries_used;