Commit 9e4ef69e by Ian Lance Taylor Committed by Ian Lance Taylor

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
parent c7573249
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> 2011-09-23 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (jump_func_type): Updated comments. * ipa-prop.h (jump_func_type): Updated comments.
...@@ -301,11 +301,13 @@ go_define (unsigned int lineno, const char *buffer) ...@@ -301,11 +301,13 @@ go_define (unsigned int lineno, const char *buffer)
case '\'': case '\'':
{ {
char quote; char quote;
int count;
if (saw_operand) if (saw_operand)
goto unknown; goto unknown;
quote = *p; quote = *p;
*q++ = *p++; *q++ = *p++;
count = 0;
while (*p != quote) while (*p != quote)
{ {
int c; int c;
...@@ -313,6 +315,8 @@ go_define (unsigned int lineno, const char *buffer) ...@@ -313,6 +315,8 @@ go_define (unsigned int lineno, const char *buffer)
if (*p == '\0') if (*p == '\0')
goto unknown; goto unknown;
++count;
if (*p != '\\') if (*p != '\\')
{ {
*q++ = *p++; *q++ = *p++;
...@@ -358,7 +362,15 @@ go_define (unsigned int lineno, const char *buffer) ...@@ -358,7 +362,15 @@ go_define (unsigned int lineno, const char *buffer)
goto unknown; goto unknown;
} }
} }
*q++ = *p++; *q++ = *p++;
if (quote == '\'' && count != 1)
goto unknown;
saw_operand = true;
need_operand = false;
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment