From 1f3d9c636bc9510154a93ea10c0ceebcb038af15 Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Fri, 16 Oct 1998 12:40:02 +0000 Subject: [PATCH] c-lex.c (yylex): Fix unaligned access of wchar_t. Fri Oct 16 15:26:24 1998 Dave Brolley * c-lex.c (yylex): Fix unaligned access of wchar_t. From-SVN: r23133 --- gcc/ChangeLog | 4 ++++ gcc/c-lex.c | 12 +++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0a2918802a6..dd152b9114f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Fri Oct 16 15:26:24 1998 Dave Brolley + + * c-lex.c (yylex): Fix unaligned access of wchar_t. + Fri Oct 16 10:47:53 1998 Nick Clifton * config/arm/arm.h (TARGET_SWITCHES): Add --help documentation. 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 */ }