lua-users home
lua-l archive

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


On 18 July 2016 at 16:53, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> This one was a pain to minify from the original ~200kb test... until I
>> realized that it needs a minimum number of unique constants to trigger.
>>
>> -- begin test case --
>> [...]
>
> So, it seems that the order in 'codebinexpval' matters, after all :-)
> (Dibyendu, remember this [1]?)
>
> The fix seems to be only this:
>
>  static void codebinexpval (FuncState *fs, OpCode op,
>                             expdesc *e1, expdesc *e2, int line) {
> -  int rk1 = luaK_exp2RK(fs, e1);  /* both operands are "RK" */
> -  int rk2 = luaK_exp2RK(fs, e2);
> +  int rk2 = luaK_exp2RK(fs, e2);  /* both operands are "RK" */
> +  int rk1 = luaK_exp2RK(fs, e1);
>
> [1] http://lua-users.org/lists/lua-l/2016-06/msg00151.html
>

I made the same change when I merged 5.3.3 changes into Ravi. Perhaps
would be useful to put a comment there to say that the order is
important.

I am glad that there is a proper explanation of the issue!

Regards
Dibyendu