-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SETLIST with c==0 #41
Labels
Comments
case OP_SETLIST:
{
if (c==0) {
Instruction i_next_arg = code[++pc];
#if LUA_VERSION_NUM == 501
c = i_next_arg;
#endif
#if LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503
if (GET_OPCODE(i_next_arg) == OP_EXTRAARG) {
c = GETARG_Ax(i_next_arg);
} else {
SET_ERROR(F, "SETLIST with c==0, but not followed by EXTRAARG.");
}
#endif
}
TRY(SetList(F, a, b, c));
break;
} |
add test cases: -- setlist c=0 when top>=25550
-- loadkx and extraarg when top>=2^18
print("local x={")
local top = arg[1] or 2^18
local count = 0
for i = 0, top do
io.stdout:write(i,",")
count = count + 1
if count == 20 then
io.stdout:write("\n")
count = 0
end
end
if count ~= 0 then
io.stdout:write("\n")
end
print("}")
|
viruscamp
added a commit
that referenced
this issue
Nov 22, 2015
extern const char* const stmttype[]; fix stmttype[] to fit StatementType test null in ClearExpression
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SETLIST A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B
If C is 0, the next instruction is cast as an integer, and used as the C value.This happens only when operand C is unable to encode the block number,i.e. when C > 511, equivalent to an array index greater than 25550.
如果 C 是 0,下一条指令被转换为整数并用作 C 的值。只有当操作数 C 不能编码块编号时出现该情况,例如当 C > 511 时,等同于数组索引大于25550。
The text was updated successfully, but these errors were encountered: