PATCH: PR preprocessor/36479: Short buffer in libcpp

H.J. Lu hjl.tools@gmail.com
Mon Jun 9 20:19:00 GMT 2008


cvt is return from

(gdb) step
converter_for_type (pfile=0x1059480, type=CPP_STRING)
    at /net/gnu-13/export/gnu/src/gcc/gcc/libcpp/charset.c:1329
1329	  switch (type)

static struct cset_converter
converter_for_type (cpp_reader *pfile, enum cpp_ttype type)
{
  switch (type)
    {
    default:
        return pfile->narrow_cset_desc;
    case CPP_CHAR16:
    case CPP_STRING16:
        return pfile->char16_cset_desc;
    case CPP_CHAR32:
    case CPP_STRING32:
        return pfile->char32_cset_desc;
    case CPP_WCHAR:
    case CPP_WSTRING:
        return pfile->wide_cset_desc;
    }
}

It is set from

  pfile->narrow_cset_desc = init_iconv_desc (pfile, ncset, SOURCE_CHARSET);
  pfile->narrow_cset_desc.width = CPP_OPTION (pfile, char_precision);

It may be related to

http://gcc.gnu.org/ml/gcc-patches/2008-04/msg01235.html

H.J.
--
On Mon, Jun 9, 2008 at 12:36 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "H.J." == H J Lu <hjl.tools@gmail.com> writes:
>
> H.J.>   PR preprocessor/36479
> H.J.>   * charset.c (emit_numeric_escape): Handle 0 width.
>
> When can width be 0?
>
> This looks like PR 36379 now.
>
> I suspect perhaps some fallout from the recent patch for cpp-ization
> of gfortran.  Though, that is just a guess.
>
> Tom
>



-- 
H.J.



More information about the Gcc-patches mailing list