lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Am 14.05.2013 07:35 schröbte Mark Gabby:
LPeg crashes with the following code in Lua 5.2:

local lpeg = require "lpeg"

local P = lpeg.P
local R = lpeg.R
local op_multiply = P "*" + "\195\151" + "\194\183"
local op_divide = P "/" + "\226\136\149"
local result = R"09" * ( op_multiply + op_divide ) * R"09"

result:match( "6/2" )

The sample code crashes for me too (most of the time), using Lua 5.2.2, LPeg 0.11 on Ubuntu 13.04, amd64. I don't know what's wrong, I can't get a usable stack trace even if I recompile both lua and lpeg with debug symbols and statically link them together, but so far I haven't been able to crash the (yet unreleased?) 0.12 version of LPeg.

Philipp