godump.c (go_define): Treat a single character in single quotes, or a string, as...
authorIan Lance Taylor <iant@google.com>
Fri, 23 Sep 2011 14:28:13 +0000 (14:28 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 23 Sep 2011 14:28:13 +0000 (14:28 +0000)
* godump.c (go_define): Treat a single character in single quotes,
or a string, as an operand.

From-SVN: r179118

gcc/ChangeLog
gcc/godump.c

index 65f8bce51eaa516178b9d7400f0be6cff7af9ed7..424404f40f4e53f4c2c8427651219bd012fd39de 100644 (file)
@@ -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.
index 3f78eead279446ab84e84d50430337a1a92b5c20..11cd32998ec92f737e225e5cbcd4e1d2759116f8 100644 (file)
@@ -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;
          }