lua-users home
lua-l archive

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


> 2015-04-09 23:34 GMT+08:00 Roberto Ierusalimschy <roberto@inf.puc-rio.br>:
> 
> >
> > --- lvm.c       2015/03/30 15:45:01     2.238
> > +++ lvm.c       2015/04/09 15:30:13
> > @@ -275,9 +275,14 @@
> >      return l_strcmp(tsvalue(l), tsvalue(r)) <= 0;
> >    else if ((res = luaT_callorderTM(L, l, r, TM_LE)) >= 0)  /* first try 'le' */
> >      return res;
> > -  else if ((res = luaT_callorderTM(L, r, l, TM_LT)) < 0)  /* else try 'lt' */
> > -    luaG_ordererror(L, l, r);
> > -  return !res;
> > +  else {  /* try 'lt': */
> > +    L->ci->callstatus |= CIST_LEQ;  /* mark it is doing 'lt' for 'le' */
> > +    res = luaT_callorderTM(L, r, l, TM_LT);
> > +    L->ci->callstatus ^= CIST_LEQ;  /* clear mark */
> > +    if (res < 0)
> > +      luaG_ordererror(L, l, r);
> > +    return !res;  /* result is negated */
> > +  }
> >  }
> 
> I saw this patch in bugs page (http://www.lua.org/bugs.html) now.
> 
> But, Is this the patch base on the Lua 5.3.0 ? I can't patch it to the
> official release.
> 
> The line 275 of lvm.c (http://www.lua.org/source/5.3/lvm.c.html) is
> the function luaV_lessthan, not luaV_lessequal .

Sorry about that. That patch is against lvm.c 2.238, while the source
in 5.3.0 is 2.232. We will correct the patch. (Meanwhile, I guess
you can apply it using the surronding context, which did not change.)

-- Roberto