lua

A copy of the Lua development repository
Log | Files | Refs | README

commit bdfab46c220681f4dc0663bbce4026f4bbada00b
parent 568794956025183fc9a9b79e0c818a885e3d0aeb
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Thu,  4 Feb 1999 16:59:09 -0200

"errorim" now is _ERRORMESSAGE.

Diffstat:
Mltm.c | 11+++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/ltm.c b/ltm.c @@ -1,5 +1,5 @@ /* -** $Id: ltm.c,v 1.19 1999/01/13 19:08:10 roberto Exp roberto $ +** $Id: ltm.c,v 1.20 1999/01/15 13:11:57 roberto Exp roberto $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -164,6 +164,7 @@ char *luaT_travtagmethods (int (*fn)(TObject *)) { /* ORDER IM */ #ifdef LUA_COMPAT2_5 #include "lapi.h" +#include "lstring.h" static void errorFB (void) { @@ -199,11 +200,13 @@ void luaT_setfallback (void) { lua_Object func = lua_getparam(2); luaL_arg_check(lua_isfunction(func), 2, "function expected"); switch (luaL_findstring(name, oldnames)) { - case 0: /* old error fallback */ - oldfunc = L->errorim; - L->errorim = *luaA_Address(func); + case 0: { /* old error fallback */ + TObject *em = &(luaS_new("_ERRORMESSAGE")->u.s.globalval); + oldfunc = *em; + *em = *luaA_Address(func); replace = errorFB; break; + } case 1: /* old getglobal fallback */ oldfunc = *luaT_getim(LUA_T_NIL, IM_GETGLOBAL); *luaT_getim(LUA_T_NIL, IM_GETGLOBAL) = *luaA_Address(func);