lua-users home
lua-l archive

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


> I'm working on a lua disassembler. I think I have found 2 mistake in
> comments of OpCode.
> 
> In 5.2 OP_JMP be used instead of OP_CLOSE. But the comment says in line 199
> of lua-5.2.3/src/lopcodes.h:
>     OP_JMP,/* A sBx pc+=sBx; if (A) close all upvalues >= R(A) + 1 */
> I think it is wrong, it should be:
>     OP_JMP,/* A sBx pc+=sBx; if (A) close all upvalues >= R(A - 1) */
> See lua-5.2/src/lvm.c line 504:
>     if (a > 0) luaF_close(L, ci->u.l.base + a - 1);

You are right. Thanks for the feedback.

-- Roberto