Debug information about extra arguments from __call

'debug.getinfo' can return number of extra arguments added to a call by
a chain of __call metavalues. That information is being used to improve
error messages about errors in these extra arguments.
This commit is contained in:
Roberto Ierusalimschy
2024-11-19 14:09:18 -03:00
parent b117bdb344
commit 50c7c915ee
9 changed files with 83 additions and 12 deletions

View File

@@ -1900,6 +1900,10 @@ static struct X { int x; } x;
else if EQ("closeslot") {
lua_closeslot(L1, getnum);
}
else if EQ("argerror") {
int arg = getnum;
luaL_argerror(L1, arg, getstring);
}
else luaL_error(L, "unknown instruction %s", buff);
}
return 0;