aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-03-20 09:05:49 +0000
committerRichard Stallman <rms@gnu.org>1993-03-20 09:05:49 +0000
commit8f7ac2203eb52531ee86d69dc7517256e6f7d408 (patch)
tree302ceed3d14f285a98117c96c26ebaa3af655085 /gcc
parent2bb3413d31c03a097df9dd8015a430aa9cdb1926 (diff)
downloadgcc-8f7ac2203eb52531ee86d69dc7517256e6f7d408.zip
gcc-8f7ac2203eb52531ee86d69dc7517256e6f7d408.tar.gz
gcc-8f7ac2203eb52531ee86d69dc7517256e6f7d408.tar.bz2
(yylex): Copy the string value we get from __FUNCTION__.
From-SVN: r3798
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-lex.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 36cffbb..c55ac2c 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -1167,7 +1167,12 @@ yylex ()
&& DECL_INITIAL (lastiddecl) != 0
&& TREE_CODE (DECL_INITIAL (lastiddecl)) == STRING_CST)
{
- yylval.ttype = DECL_INITIAL (lastiddecl);
+ tree stringval = DECL_INITIAL (lastiddecl);
+
+ /* 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;
}
else if (doing_objc_thang)