diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-03-26 19:22:41 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-03-26 19:22:41 -0300 |
commit | 9e9e2ea287a24871e6e35faef52ae236bf85f8ae (patch) | |
tree | b81438536f5580862838be56afff18897ae03075 | |
parent | 03d917f229107d788df93c940d87b5908194248a (diff) | |
download | lua-9e9e2ea287a24871e6e35faef52ae236bf85f8ae.tar.gz lua-9e9e2ea287a24871e6e35faef52ae236bf85f8ae.tar.bz2 lua-9e9e2ea287a24871e6e35faef52ae236bf85f8ae.zip |
BUG: must mark userdata in garbage collection.
-rw-r--r-- | table.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** Module to control static tables | 3 | ** Module to control static tables |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_table="$Id: table.c,v 2.62 1997/03/21 18:52:37 roberto Exp $"; | 6 | char *rcs_table="$Id: table.c,v 2.62 1997/03/21 21:39:57 roberto Exp roberto $"; |
7 | 7 | ||
8 | #include "mem.h" | 8 | #include "mem.h" |
9 | #include "opcode.h" | 9 | #include "opcode.h" |
@@ -128,7 +128,8 @@ static char *lua_travsymbol (int (*fn)(Object *)) | |||
128 | */ | 128 | */ |
129 | int lua_markobject (Object *o) | 129 | int lua_markobject (Object *o) |
130 | {/* if already marked, does not change mark value */ | 130 | {/* if already marked, does not change mark value */ |
131 | if (ttype(o) == LUA_T_STRING && !tsvalue(o)->marked) | 131 | if (ttype(o) == LUA_T_USERDATA || |
132 | (ttype(o) == LUA_T_STRING && !tsvalue(o)->marked)) | ||
132 | tsvalue(o)->marked = 1; | 133 | tsvalue(o)->marked = 1; |
133 | else if (ttype(o) == LUA_T_ARRAY) | 134 | else if (ttype(o) == LUA_T_ARRAY) |
134 | lua_hashmark (avalue(o)); | 135 | lua_hashmark (avalue(o)); |