This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] Improve the old fix for 11095
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Paolo Carlini <pcarlini at unitus dot it>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Fri, 10 Oct 2003 10:13:38 -0500
- Subject: Re: [Patch] Improve the old fix for 11095
- Organization: Red Hat / Chicago
- References: <3F86B8F3.4040902@unitus.it>
This use of __builtin_alloca is wrong...
if (__w > __len)
{
! __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
! * __w));
! __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
&__c, __w, __len, false);
__len = __w;
}
! __out._M_write(__cs, __len);
__cs is only valid in the scope of the if block, but is used outside of
it (in __out._M_write(__cs, __len).
-benjamin