diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-23 14:28:13 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-23 14:28:13 +0000 |
commit | e8a63dfe1ecdfb3efc675253506b4336af5181c7 (patch) | |
tree | d772d9109c88179366bd7fa7753cb5600bb2d081 /gcc/godump.c | |
parent | ee4fcf242e182be5eb30e8e54dd005659d896cb3 (diff) | |
download | gcc-e8a63dfe1ecdfb3efc675253506b4336af5181c7.tar.gz |
* godump.c (go_define): Treat a single character in single quotes,
or a string, as an operand.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179118 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/godump.c')
-rw-r--r-- | gcc/godump.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/godump.c b/gcc/godump.c index 3f78eead279..11cd32998ec 100644 --- a/gcc/godump.c +++ b/gcc/godump.c @@ -301,11 +301,13 @@ go_define (unsigned int lineno, const char *buffer) case '\'': { char quote; + int count; if (saw_operand) goto unknown; quote = *p; *q++ = *p++; + count = 0; while (*p != quote) { int c; @@ -313,6 +315,8 @@ go_define (unsigned int lineno, const char *buffer) if (*p == '\0') goto unknown; + ++count; + if (*p != '\\') { *q++ = *p++; @@ -358,7 +362,15 @@ go_define (unsigned int lineno, const char *buffer) goto unknown; } } + *q++ = *p++; + + if (quote == '\'' && count != 1) + goto unknown; + + saw_operand = true; + need_operand = false; + break; } |