[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lpeg pattern limit and hacking
- From: Patrick Donnelly <batrick@...>
- Date: Mon, 22 Jun 2009 02:27:06 -0600
2009/6/22 Cheng, Long <firstname.lastname@example.org>:
> Hi all:
> We have a lua program using lpeg to do some data validation job. The
> input data is a customized data format expression and lot of data (all
> in string format). The program parses the input data format expression
> and generates a new lpeg pattern, which is then used to validate all the
> data strings. The problem we encounted was for some complicated data
> format expression, the generated lpeg pattern exceeds the buildin
> pattern limit MAXPATTSIZE. After a quick glance into lpeg.c source code
> I simply changed the MAXPATTSIZE to INT_MAX - 10 and two occusion of
> "short" to "int". The patch is attached below. From my testing results,
> the program runs well under this patch. I dont have deep understanding
> of the lpeg implementation, so I write to this list asking if anyone can
> confirm that is there any problem with this patch. Thanks!
This has been brought up before . It is apparently ok to do.
"Let all men know thee, but no man know thee thoroughly: Men freely
ford that see the shallows."
- Benjamin Franklin