diff options
Diffstat (limited to 'ltm.c')
| -rw-r--r-- | ltm.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltm.c,v 1.42 2000/06/08 17:48:31 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 1.43 2000/06/12 13:52:05 roberto Exp roberto $ |
| 3 | ** Tag methods | 3 | ** Tag methods |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -69,17 +69,17 @@ static void init_entry (lua_State *L, int tag) { | |||
| 69 | 69 | ||
| 70 | void luaT_init (lua_State *L) { | 70 | void luaT_init (lua_State *L) { |
| 71 | int t; | 71 | int t; |
| 72 | L->last_tag = NUM_TAGS-1; | ||
| 73 | luaM_growvector(L, L->IMtable, 0, NUM_TAGS, struct IM, "", MAX_INT); | 72 | luaM_growvector(L, L->IMtable, 0, NUM_TAGS, struct IM, "", MAX_INT); |
| 73 | L->last_tag = NUM_TAGS-1; | ||
| 74 | for (t=0; t<=L->last_tag; t++) | 74 | for (t=0; t<=L->last_tag; t++) |
| 75 | init_entry(L, t); | 75 | init_entry(L, t); |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | 78 | ||
| 79 | int lua_newtag (lua_State *L) { | 79 | int lua_newtag (lua_State *L) { |
| 80 | ++L->last_tag; | ||
| 81 | luaM_growvector(L, L->IMtable, L->last_tag, 1, struct IM, | 80 | luaM_growvector(L, L->IMtable, L->last_tag, 1, struct IM, |
| 82 | "tag table overflow", MAX_INT); | 81 | "tag table overflow", MAX_INT); |
| 82 | L->last_tag++; | ||
| 83 | init_entry(L, L->last_tag); | 83 | init_entry(L, L->last_tag); |
| 84 | return L->last_tag; | 84 | return L->last_tag; |
| 85 | } | 85 | } |
