aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-08-19 18:39:25 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-08-19 18:39:25 -0300
commit3e88b72b8e71c0946d089a04876e7bdc61d187a9 (patch)
tree46e84129fc3d40c1fb66b6913ee3b70d0c1703b0 /lcode.c
parent8b752ddf14c1987411906d07a8c68f72f168b9b7 (diff)
downloadlua-3e88b72b8e71c0946d089a04876e7bdc61d187a9.tar.gz
lua-3e88b72b8e71c0946d089a04876e7bdc61d187a9.tar.bz2
lua-3e88b72b8e71c0946d089a04876e7bdc61d187a9.zip
A return can have at most 254 values
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lcode.c b/lcode.c
index e7750fff..8786a721 100644
--- a/lcode.c
+++ b/lcode.c
@@ -208,6 +208,8 @@ void luaK_ret (FuncState *fs, int first, int nret) {
208 case 1: op = OP_RETURN1; break; 208 case 1: op = OP_RETURN1; break;
209 default: op = OP_RETURN; break; 209 default: op = OP_RETURN; break;
210 } 210 }
211 if (nret + 1 > MAXARG_B)
212 luaX_syntaxerror(fs->ls, "too many returns");
211 luaK_codeABC(fs, op, first, nret + 1, 0); 213 luaK_codeABC(fs, op, first, nret + 1, 0);
212} 214}
213 215