On Wed, Dec 11, 2019 at 12:10 AM Hans Hagen <j.ha...@xs4all.nl> wrote:

> On 12/11/2019 12:03 AM, luigi scarso wrote:
> >
> >
> > On Tue, Dec 10, 2019 at 9:27 PM Henri Menke <henrime...@gmail.com
> > <mailto:henrime...@gmail.com>> wrote:
> >
> >     Dear devs,
> >
> >     The example below crashes LuaTeX with a segmentation fault.  It is
> >     reproducible
> >     with LuaTeX 1.10.1 7143 and LuaTeX 1.11.2 7226.  To this end I built
> >     7226 from
> >     source with --debugopt to get a backtrace, which can be found below
> >     as well.
> >
> >     Cheers, Henri
> >
> >     ---
> >
> >     \directlua{token.set_macro(-1, "foo","\string\\,")}
> >     \show\foo
> >     \foo
> >     \bye
> >
> >
> > I guess that we have to check if catcodetable -1 is already defined...
> i already sent you a patch, probbaly also ok for trunk
>


yes, seen



> but one needs to be careful as fo rinstance \string\foo is seen as
> <formfeed>oo so often one also needs to escape properly
>

 I always start with  [==[ ... ]==]  ie
\directlua{token.set_macro(-1, [==[foo]==],[==[\string\\,]==])}
 gdb reports this [==[\string\\,]==] string as
 "\\\\,"
which is an array of char of length 3 ie {'\\','\\',','}

With \directlua{token.set_macro(-1, [==[foo]==],"\string\\,")}
gdb reports "\\,"
ie {'\\','\,'}

I always check which one is the correct one...

-- 
luigi
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to