aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2012-02-22 16:26:50 +0100
committerMike Pall <mike>2012-02-22 16:26:50 +0100
commit5e113d0058a3201f88e6f1701050f0e50067bb39 (patch)
tree50d27cb5720310a36d01338fef2d7836b2ea4b33 /src
parent6c05739684527919293e25668589f17c35a7c129 (diff)
downloadluajit-5e113d0058a3201f88e6f1701050f0e50067bb39.tar.gz
luajit-5e113d0058a3201f88e6f1701050f0e50067bb39.tar.bz2
luajit-5e113d0058a3201f88e6f1701050f0e50067bb39.zip
Fix argument type in error message for relative arguments.
Diffstat (limited to 'src')
-rw-r--r--src/lj_err.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lj_err.c b/src/lj_err.c
index 4ebef8a0..c1e8c561 100644
--- a/src/lj_err.c
+++ b/src/lj_err.c
@@ -676,7 +676,7 @@ LJ_NOINLINE void lj_err_arg(lua_State *L, int narg, ErrMsg em)
676/* Typecheck error for arguments. */ 676/* Typecheck error for arguments. */
677LJ_NOINLINE void lj_err_argtype(lua_State *L, int narg, const char *xname) 677LJ_NOINLINE void lj_err_argtype(lua_State *L, int narg, const char *xname)
678{ 678{
679 TValue *o = L->base + narg-1; 679 TValue *o = narg < 0 ? L->top + narg : L->base + narg-1;
680 const char *tname = o < L->top ? typename(o) : lj_obj_typename[0]; 680 const char *tname = o < L->top ? typename(o) : lj_obj_typename[0];
681 const char *msg = lj_str_pushf(L, err2msg(LJ_ERR_BADTYPE), xname, tname); 681 const char *msg = lj_str_pushf(L, err2msg(LJ_ERR_BADTYPE), xname, tname);
682 err_argmsg(L, narg, msg); 682 err_argmsg(L, narg, msg);