lex.c (real_yylex): Fix unaligned access of wchar_t.
authorDave Brolley <brolley@cygnus.com>
Fri, 16 Oct 1998 12:42:35 +0000 (12:42 +0000)
committerDave Brolley <brolley@gcc.gnu.org>
Fri, 16 Oct 1998 12:42:35 +0000 (08:42 -0400)
1998-10-16  Dave Brolley  <brolley@cygnus.com>
        * lex.c (real_yylex): Fix unaligned access of wchar_t.

From-SVN: r23134

gcc/cp/ChangeLog
gcc/cp/lex.c

index 50694eeab09510bfa77649769c2a68157cddb5e1..317161bf1cca06c7decf77f403a729d17dee8ef1 100644 (file)
@@ -1,3 +1,7 @@
+1998-10-16  Dave Brolley  <brolley@cygnus.com>
+
+        * lex.c (real_yylex): Fix unaligned access of wchar_t.
+
 1998-10-16  Mark Mitchell  <mark@markmitchell.com>
 
        * class.c (add_method): Fix documentation to reflect previous
index d69dc6ea452b977bfbc5adbbd33ddcabf0022806..3f0ab4773355970e0e840026a4cd40db1d3338af 100644 (file)
@@ -4214,15 +4214,13 @@ real_yylex ()
                    /* mbtowc sometimes needs an extra char before accepting */
                    if (char_len <= i)
                      put_back (c);
-                   if (wide_flag)
+                   if (wide_flag)
                      {
-                       *(wchar_t *)p = wc;
-                       p += sizeof (wc);
+                       p += (i + 1);
+                       c = getch ();
+                       continue;
                      }
-                   else
-                     p += (i + 1);
-                   c = getch ();
-                   continue;
+                   c = wc;
                  }
 #endif /* MULTIBYTE_CHARS */
              }