summaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
authorbrolley <brolley@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-16 12:40:02 +0000
committerbrolley <brolley@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-16 12:40:02 +0000
commitcded3b4e8e5cb228e05645596c298fd19f1bfef0 (patch)
treed7d8a02fd213f47e71c495dcf72417b03db0a277 /gcc/c-lex.c
parent5b35cb67abeab1199c63b82e48661e9d11ba2f76 (diff)
downloadgcc-cded3b4e8e5cb228e05645596c298fd19f1bfef0.tar.gz
Fri Oct 16 15:26:24 1998 Dave Brolley <brolley@cygnus.com>
* c-lex.c (yylex): Fix unaligned access of wchar_t. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23133 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index ec1386ae59c..6c0d29f7889 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -2036,15 +2036,13 @@ yylex ()
/* mbtowc sometimes needs an extra char before accepting */
if (char_len <= i)
UNGETC (c);
- if (wide_flag)
+ if (! wide_flag)
{
- *(wchar_t *)p = wc;
- p += sizeof (wc);
+ p += (i + 1);
+ c = GETC ();
+ continue;
}
- else
- p += (i + 1);
- c = GETC ();
- continue;
+ c = wc;
}
#endif /* MULTIBYTE_CHARS */
}