aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2008-03-24 18:53:34 +0000
committerTom Tromey <tromey@gcc.gnu.org>2008-03-24 18:53:34 +0000
commit50c91950d46fd5715ffd198227c50c7bce35f915 (patch)
tree5ecab7b12713063b20d0e3648aa74566b2f832c5 /gcc/cp
parent8fc789c82e053517281e28e141f8832d5c2f7f6e (diff)
downloadgcc-50c91950d46fd5715ffd198227c50c7bce35f915.zip
gcc-50c91950d46fd5715ffd198227c50c7bce35f915.tar.gz
gcc-50c91950d46fd5715ffd198227c50c7bce35f915.tar.bz2
lex.c (handle_pragma_interface): Don't copy the filename.
* lex.c (handle_pragma_interface): Don't copy the filename. (handle_pragma_implementation): Copy filename using xstrdup. From-SVN: r133487
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/lex.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index eaaddc8..ce147f7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-24 Tom Tromey <tromey@redhat.com>
+
+ * lex.c (handle_pragma_interface): Don't copy the filename.
+ (handle_pragma_implementation): Copy filename using xstrdup.
+
2008-03-21 Paolo Carlini <pcarlini@suse.de>
* cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index adf793b..4552305 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -518,7 +518,7 @@ handle_pragma_interface (cpp_reader* dfile ATTRIBUTE_UNUSED )
else if (fname == 0)
filename = lbasename (input_filename);
else
- filename = ggc_strdup (TREE_STRING_POINTER (fname));
+ filename = TREE_STRING_POINTER (fname);
finfo = get_fileinfo (input_filename);
@@ -566,7 +566,7 @@ handle_pragma_implementation (cpp_reader* dfile ATTRIBUTE_UNUSED )
}
else
{
- filename = ggc_strdup (TREE_STRING_POINTER (fname));
+ filename = TREE_STRING_POINTER (fname);
if (cpp_included_before (parse_in, filename, input_location))
warning (0, "#pragma implementation for %qs appears after "
"file is included", filename);
@@ -580,7 +580,7 @@ handle_pragma_implementation (cpp_reader* dfile ATTRIBUTE_UNUSED )
if (ifiles == 0)
{
ifiles = XNEW (struct impl_files);
- ifiles->filename = filename;
+ ifiles->filename = xstrdup (filename);
ifiles->next = impl_file_chain;
impl_file_chain = ifiles;
}