Re: [pcre-dev] Calculated match recursion stack size

Αρχική Σελίδα
Delete this message
Συντάκτης: Philip Hazel
Ημερομηνία:  
Προς: Graycode
Υ/ο: pcre-dev
Αντικείμενο: Re: [pcre-dev] Calculated match recursion stack size
On Sat, 21 Jan 2012, Graycode wrote:

> I think the root cause is a few lines above the #include you showed
> above from pcretest.c:
>
> #define PCRE_INCLUDED
> #undef PRIV
> #define PRIV(name) name
>
> #include "pcre_tables.c"
>
> So PRIV(utf8_table3) within a compile of pcretest.c (and its included
> pcre_tables.c) would be just 'utf8_table3'.


Yes, I started to worry about that too.

> Prior versions had a #include of pcre_printint.SRC in pcretest.c,
> maybe this was the reason ??


Indeed. The change was made so that an 8-bit and a 16-bit version of
printint could be compiled (as needed) and linked with a single version
of pcretest. We obviously overlooked the implication for the tables.

The code for printint knows when it is being compiled separately (as
opposed to being included by pcre_compile for testing purposes) and so
it could also arrange to change the names, but the tables that are built
inside pcretest.c would have to be made global so that the code in
printint could see them. However, I see no reason why that should not be
done. After all, we are building a complete application out of a small
number of source files that can share whatever variables they like.

I'll make up an appropriate patch and send it to you to try on the RC1
tarball.

Philip

--
Philip Hazel