diff options
author | Andris Pavenis <pavenis@latnet.lv> | 2004-07-16 20:07:01 +0300 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2004-07-16 17:07:01 +0000 |
commit | a23ee064e26afca80e24ccc9036ef01f54b1f377 (patch) | |
tree | 731f455afa7023a8116cc6a957e079da9a2f3e35 /libcpp | |
parent | 043fdfc83e4f2e5d2b355df7ee722fd118c97e5c (diff) | |
download | gcc-a23ee064e26afca80e24ccc9036ef01f54b1f377.zip gcc-a23ee064e26afca80e24ccc9036ef01f54b1f377.tar.gz gcc-a23ee064e26afca80e24ccc9036ef01f54b1f377.tar.bz2 |
re PR preprocessor/16366 (Preprocessor option -remap causes memory corruption)
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
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 7 | ||||
-rw-r--r-- | libcpp/files.c | 5 | ||||
-rw-r--r-- | libcpp/internal.h | 1 |
3 files changed, 12 insertions, 1 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 2cdd784..48fdf38 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -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 diff --git a/libcpp/files.c b/libcpp/files.c index cd8d077..fc1fa2c 100644 --- a/libcpp/files.c +++ b/libcpp/files.c @@ -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. */ diff --git a/libcpp/internal.h b/libcpp/internal.h index 845f1eb..0a7eb10 100644 --- a/libcpp/internal.h +++ b/libcpp/internal.h @@ -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; |