This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/16366] Preprocessor option -remap causes memory corruption
- From: "pavenis at latnet dot lv" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jul 2004 05:54:39 -0000
- Subject: [Bug preprocessor/16366] Preprocessor option -remap causes memory corruption
- References: <20040705054530.16366.pavenis@latnet.lv>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pavenis at latnet dot lv 2004-07-05 05:54 -------
Created an attachment (id=6688)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6688&action=view)
Patch to fix the bug
The reason was that in case if option -remap was specified pfile->file_hash
was updated before attempt to use pointer hash_slot. If the array additionally
gets reallocated then the result is accessing already freed memory. Calling
htab_find_slot_with_hash once more later fixes the problem (verified for
i586-pc-msdosdjgpp)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16366