mirror of
https://github.com/lua/lua
synced 2026-09-26 16:17:11 +03:00
A return can have at most 254 values
This commit is contained in:
parent
8b752ddf14
commit
3e88b72b8e
2 changed files with 13 additions and 0 deletions
2
lcode.c
2
lcode.c
|
|
@ -208,6 +208,8 @@ void luaK_ret (FuncState *fs, int first, int nret) {
|
|||
case 1: op = OP_RETURN1; break;
|
||||
default: op = OP_RETURN; break;
|
||||
}
|
||||
if (nret + 1 > MAXARG_B)
|
||||
luaX_syntaxerror(fs->ls, "too many returns");
|
||||
luaK_codeABC(fs, op, first, nret + 1, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue