[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.3.4 and LPeg 1.0.1 dumped core on me
- From: Albert Chan <albertmcchan@...>
- Date: Tue, 13 Nov 2018 14:12:50 -0500
> Here is a small testcase (note that shortening the string eliminates the
> error):
>
> local lpeg = require 'lpeg'
> local P,Cs,Cmt = lpeg.P, lpeg.Cs, lpeg.Cmt
> local pat1 = P"a" / "b" + Cmt(P"c", function(_,p) return p,"d" end) + P(1)
> local pat = Cs(pat1^1)
> print(pat:match("abcdabcdabcdabcdabcdabcdabcdabc"))'
>
> --
> Andrew.
What is above test code supposed to show ?
I tried it on lpeg 1.0.1 without problem ...
OTTH, if string is longer than ('abcd'):rep(5510), it did *crash*
Your 1 char patch, (n + 2) to (n + 1) seems to fix it.
Thanks.