From 6290d6f5d08cc73ebd73d4363996f4f258ac7dcb Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Fri, 26 Nov 2010 13:20:56 +0100 Subject: [PATCH] Display caller location in errors from metamethods. --- src/lj_err.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lj_err.c b/src/lj_err.c index 8a80c9c8..65029092 100644 --- a/src/lj_err.c +++ b/src/lj_err.c @@ -904,7 +904,8 @@ LJ_NOINLINE void lj_err_optype_call(lua_State *L, TValue *o) LJ_NOINLINE void lj_err_callermsg(lua_State *L, const char *msg) { cTValue *frame = L->base-1; - cTValue *pframe = frame_islua(frame) ? frame_prevl(frame) : NULL; + cTValue *pframe = frame_islua(frame) ? frame_prevl(frame) : + frame_iscont(frame) ? frame_prevd(frame) : NULL; err_loc(L, msg, pframe, frame); lj_err_run(L); }