[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Comment of OP_CLOSE in lua 5.2 is wrong
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 20 Oct 2014 16:32:27 -0200
> 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