[Dev-luatex] Argument checking in ltexlib.c

luigi scarso luigi.scarso at gmail.com
Fri Aug 23 21:19:33 CEST 2019


On Fri, Aug 23, 2019 at 9:11 AM Hans Hagen <j.hagen at xs4all.nl> wrote:

> On 8/23/2019 12:43 AM, Marcel Fabian Kr├╝ger wrote:
> > Hello,
> >
> > in tex_setmathparm and tex_getmathparm from ltexlib.c, `i` stores the
> > index of the math parameter to query or set. Given that `i` is obtained
> > through luaL_checkoption it should never have a invalid value. The
> > function still check that `i` is in the valid range using the check
> >
> >          if (i<0 && i>=math_param_last) {
> >              /* invalid spec, just ignore it  */
> >
> > I think this is a typo because i>=math_param_last (with
> > math_param_last=114) implies i>0 and therefore this condition can never
> > be true. Maybe || could be used instead of && or the check could be
> > removed entirly.
> in luametatex i use this test
>
>          if (i < 0 || j < 0) {
>
> so i'll do that in luatex too
>


Committed revision 7183.
-- 
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/dev-luatex/attachments/20190823/f29ded72/attachment.html>


More information about the dev-luatex mailing list