Correct line in error message for constant function

This commit is contained in:
Roberto Ierusalimschy
2025-05-12 11:42:45 -03:00
parent 5b1ab8efdc
commit 7dc6aae290
2 changed files with 8 additions and 1 deletions

View File

@@ -1858,8 +1858,8 @@ static void funcstat (LexState *ls, int line) {
expdesc v, b;
luaX_next(ls); /* skip FUNCTION */
ismethod = funcname(ls, &v);
body(ls, &b, ismethod, line);
check_readonly(ls, &v);
body(ls, &b, ismethod, line);
luaK_storevar(ls->fs, &v, &b);
luaK_fixline(ls->fs, line); /* definition "happens" in the first line */
}