aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2011-09-23 14:28:13 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-09-23 14:28:13 +0000
commit9e4ef69ef80e6ef91c4897f0d6c0f7e47fdfd279 (patch)
treed772d9109c88179366bd7fa7753cb5600bb2d081
parentc75732496d9ad114b50a9a94b71d028bf4168059 (diff)
downloadgcc-9e4ef69ef80e6ef91c4897f0d6c0f7e47fdfd279.zip
gcc-9e4ef69ef80e6ef91c4897f0d6c0f7e47fdfd279.tar.gz
gcc-9e4ef69ef80e6ef91c4897f0d6c0f7e47fdfd279.tar.bz2
godump.c (go_define): Treat a single character in single quotes, or a string, as an operand.
* godump.c (go_define): Treat a single character in single quotes, or a string, as an operand. From-SVN: r179118
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/godump.c12
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 65f8bce..424404f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-23 Ian Lance Taylor <iant@google.com>
+
+ * godump.c (go_define): Treat a single character in single quotes,
+ or a string, as an operand.
+
2011-09-23 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (jump_func_type): Updated comments.
diff --git a/gcc/godump.c b/gcc/godump.c
index 3f78eea..11cd329 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;
}