new `__newindex' eventfield

This commit is contained in:
Roberto Ierusalimschy
2002-05-27 17:35:40 -03:00
parent 859ecf36b6
commit 46c471d7e9
8 changed files with 57 additions and 53 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lcode.c,v 1.103 2002/05/13 13:07:48 roberto Exp roberto $
** $Id: lcode.c,v 1.104 2002/05/14 17:52:22 roberto Exp roberto $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@@ -211,13 +211,11 @@ static int addk (FuncState *fs, TObject *k, TObject *v) {
return cast(int, nvalue(index));
}
else { /* constant not found; create a new entry */
TObject o;
Proto *f = fs->f;
luaM_growvector(fs->L, f->k, fs->nk, f->sizek, TObject,
MAXARG_Bx, "constant table overflow");
setobj(&f->k[fs->nk], v);
setnvalue(&o, fs->nk);
luaH_set(fs->L, fs->h, k, &o);
setnvalue(luaH_set(fs->L, fs->h, k), fs->nk);
return fs->nk++;
}
}