aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lparser.c b/lparser.c
index e5c38b6c..58b3bcba 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 1.152 2001/07/10 20:02:22 roberto Exp roberto $ 2** $Id: lparser.c,v 1.153 2001/08/10 20:53:03 roberto Exp roberto $
3** Lua Parser 3** Lua Parser
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -318,6 +318,7 @@ static void open_func (LexState *ls, FuncState *fs) {
318 fs->jlt = NO_JUMP; 318 fs->jlt = NO_JUMP;
319 fs->freereg = 0; 319 fs->freereg = 0;
320 fs->nk = 0; 320 fs->nk = 0;
321 fs->h = luaH_new(ls->L, 0);
321 fs->np = 0; 322 fs->np = 0;
322 fs->nlineinfo = 0; 323 fs->nlineinfo = 0;
323 fs->nlocvars = 0; 324 fs->nlocvars = 0;
@@ -339,6 +340,9 @@ static void close_func (LexState *ls) {
339 luaK_codeABC(fs, OP_RETURN, 0, 0, 0); /* final return */ 340 luaK_codeABC(fs, OP_RETURN, 0, 0, 0); /* final return */
340 luaK_getlabel(fs); /* close eventual list of pending jumps */ 341 luaK_getlabel(fs); /* close eventual list of pending jumps */
341 removelocalvars(ls, fs->nactloc); 342 removelocalvars(ls, fs->nactloc);
343 lua_assert(G(L)->roottable == fs->h);
344 G(L)->roottable = fs->h->next;
345 luaH_free(L, fs->h);
342 luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction); 346 luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction);
343 f->sizecode = fs->pc; 347 f->sizecode = fs->pc;
344 luaM_reallocvector(L, f->k, f->sizek, fs->nk, TObject); 348 luaM_reallocvector(L, f->k, f->sizek, fs->nk, TObject);