diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-08-19 18:39:25 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-08-19 18:39:25 -0300 |
| commit | 3e88b72b8e71c0946d089a04876e7bdc61d187a9 (patch) | |
| tree | 46e84129fc3d40c1fb66b6913ee3b70d0c1703b0 /lcode.c | |
| parent | 8b752ddf14c1987411906d07a8c68f72f168b9b7 (diff) | |
| download | lua-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.c | 2 |
1 files changed, 2 insertions, 0 deletions
| @@ -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 | ||
