summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/cp/lex.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-07-10 23:03:59 +0000
committerobrien <obrien@FreeBSD.org>1999-07-10 23:03:59 +0000
commitd4db5fb866b7ad5216abd5047774a3973b9901a9 (patch)
treeedca008aa0e9cdfae2ef7478f9109ca7f3a2a028 /contrib/gcc/cp/lex.c
parentb822db150531f5b7067d4d970080b7358e07ae89 (diff)
downloadFreeBSD-src-d4db5fb866b7ad5216abd5047774a3973b9901a9.zip
FreeBSD-src-d4db5fb866b7ad5216abd5047774a3973b9901a9.tar.gz
Virgin import of GCC 2.7.2.3
Diffstat (limited to 'contrib/gcc/cp/lex.c')
-rw-r--r--contrib/gcc/cp/lex.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/gcc/cp/lex.c b/contrib/gcc/cp/lex.c
index 22763f5..9e51883 100644
--- a/contrib/gcc/cp/lex.c
+++ b/contrib/gcc/cp/lex.c
@@ -3381,7 +3381,12 @@ real_yylex ()
&& DECL_INITIAL (tmp) != NULL_TREE
&& TREE_CODE (DECL_INITIAL (tmp)) == STRING_CST)
{
- yylval.ttype = DECL_INITIAL (tmp);
+ tree stringval = DECL_INITIAL (tmp);
+
+ /* Copy the string value so that we won't clobber anything
+ if we put something in the TREE_CHAIN of this one. */
+ yylval.ttype = build_string (TREE_STRING_LENGTH (stringval),
+ TREE_STRING_POINTER (stringval));
value = STRING;
}
}
OpenPOWER on IntegriCloud