summaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-12-29 13:15:54 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-12-29 13:15:54 -0300
commit4bd10b6fe81c0a56eb9e01e24fba10e655966870 (patch)
treeff21703d9f06a0dd4ca4f3317dd0cb7b048c9b8d /ldo.c
parent59e565d9555c07e82808d8c1db8f4f4d159b5e5c (diff)
downloadlua-github-4bd10b6fe81c0a56eb9e01e24fba10e655966870.tar.gz
Better error messages for calling non-callable objects
When available, use the calling code to find a suitable name for what was being called; this is particularly useful for errors of non-callable metamethods. This commit also improved the debug information for order metamethods.
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ldo.c b/ldo.c
index d39edab0..5e3828f4 100644
--- a/ldo.c
+++ b/ldo.c
@@ -372,7 +372,7 @@ void luaD_tryfuncTM (lua_State *L, StkId func) {
const TValue *tm = luaT_gettmbyobj(L, s2v(func), TM_CALL);
StkId p;
if (unlikely(ttisnil(tm)))
- luaG_typeerror(L, s2v(func), "call"); /* nothing to call */
+ luaG_callerror(L, s2v(func)); /* nothing to call */
for (p = L->top; p > func; p--) /* open space for metamethod */
setobjs2s(L, p, p-1);
L->top++; /* stack space pre-allocated by the caller */