summaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lgc.c b/lgc.c
index fcd22a86..e7d533d3 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 1.100 2001/06/06 18:00:19 roberto Exp roberto $ 2** $Id: lgc.c,v 1.101 2001/06/07 15:01:21 roberto Exp roberto $
3** Garbage Collector 3** Garbage Collector
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -338,12 +338,14 @@ static void callgcTM (lua_State *L, const TObject *obj) {
338 Closure *tm = luaT_gettmbyObj(G(L), obj, TM_GC); 338 Closure *tm = luaT_gettmbyObj(G(L), obj, TM_GC);
339 if (tm != NULL) { 339 if (tm != NULL) {
340 int oldah = L->allowhooks; 340 int oldah = L->allowhooks;
341 StkId top = L->top;
341 L->allowhooks = 0; /* stop debug hooks during GC tag methods */ 342 L->allowhooks = 0; /* stop debug hooks during GC tag methods */
342 luaD_checkstack(L, 2); 343 luaD_checkstack(L, 2);
343 setclvalue(L->top, tm); 344 setclvalue(top, tm);
344 setobj(L->top+1, obj); 345 setobj(top+1, obj);
345 L->top += 2; 346 L->top += 2;
346 luaD_call(L, L->top-2, 0); 347 luaD_call(L, top);
348 L->top = top; /* restore top */
347 L->allowhooks = oldah; /* restore hooks */ 349 L->allowhooks = oldah; /* restore hooks */
348 } 350 }
349} 351}