public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/4986: c-common.c, combine_strings () broken for wchar_t == 8 bits
@ 2001-12-03 3:26 ms
0 siblings, 0 replies; 3+ messages in thread
From: ms @ 2001-12-03 3:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 4986
>Category: c
>Synopsis: c-common.c, combine_strings () broken for wchar_t == 8 bits
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Dec 03 03:26:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: ms@siroyan.com
>Release: 3.0.2
>Organization:
>Environment:
Sparc Solaris
>Description:
c-common.c, combine_Strings () will attempt to widen
char to wchar_t if any of the strings being combined are
wide. The widening loop hardcodes host wchar_t sizes
equivalent to short and int, if wchar_t is setup with only 8
bits it will fall through into the (int *) branch potentially
causing a non aligned access bus error.
>How-To-Repeat:
>Fix:
I'm working around this with the following patch:
***************
*** 279,285 ****
int i;
for (i = 0; i < len; i++)
{
! if (WCHAR_TYPE_SIZE == HOST_BITS_PER_SHORT)
((short *) q)[i] = TREE_STRING_POINTER (t)[i];
else
((int *) q)[i] = TREE_STRING_POINTER (t)[i];
--- 431,439 ----
int i;
for (i = 0; i < len; i++)
{
! if (WCHAR_TYPE_SIZE == HOST_BITS_PER_CHAR)
! ((char *) q)[i] = TREE_STRING_POINTER (t)[i];
! else if (WCHAR_TYPE_SIZE == HOST_BITS_PER_SHORT)
((short *) q)[i] = TREE_STRING_POINTER (t)[i];
else
((int *) q)[i] = TREE_STRING_POINTER (t)[i];
***************
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c/4986: c-common.c, combine_strings () broken for wchar_t == 8 bits
@ 2002-02-26 18:07 rodrigc
0 siblings, 0 replies; 3+ messages in thread
From: rodrigc @ 2002-02-26 18:07 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, ms, nobody
Synopsis: c-common.c, combine_strings () broken for wchar_t == 8 bits
State-Changed-From-To: open->feedback
State-Changed-By: rodrigc
State-Changed-When: Tue Feb 26 17:37:10 2002
State-Changed-Why:
Can you provide a compilable testcase to illustrate
your problem, and why your patch is necessary?
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4986
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c/4986: c-common.c, combine_strings () broken for wchar_t == 8 bits
@ 2002-05-22 5:22 neil
0 siblings, 0 replies; 3+ messages in thread
From: neil @ 2002-05-22 5:22 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, ms, nobody
Synopsis: c-common.c, combine_strings () broken for wchar_t == 8 bits
State-Changed-From-To: feedback->closed
State-Changed-By: neil
State-Changed-When: Wed May 22 05:21:57 2002
State-Changed-Why:
Appears fixed for 3.1 and 3.2; the code has changed.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4986
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-05-22 12:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-03 3:26 c/4986: c-common.c, combine_strings () broken for wchar_t == 8 bits ms
2002-02-26 18:07 rodrigc
2002-05-22 5:22 neil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).