summaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-03-09 18:49:52 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-03-09 18:49:52 -0300
commit0969a971cd41921bd5ee72c1da880455bcca3bb4 (patch)
tree74be9a39706eeb1e7f4e5c2cf49693364c399790 /lgc.c
parentbe6d215f674f3d148d3f80a0553e8b2aa6da51d7 (diff)
downloadlua-0969a971cd41921bd5ee72c1da880455bcca3bb4.tar.gz
lua-0969a971cd41921bd5ee72c1da880455bcca3bb4.tar.bz2
lua-0969a971cd41921bd5ee72c1da880455bcca3bb4.zip
better use of "ASSERT".
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lgc.c b/lgc.c
index 14b6bceb..b5417f77 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 1.16 1998/01/19 19:49:22 roberto Exp roberto $ 2** $Id: lgc.c,v 1.17 1998/03/06 16:54:42 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*/
@@ -96,7 +96,7 @@ static int ismarked (TObject *o)
96#ifdef DEBUG 96#ifdef DEBUG
97 case LUA_T_LINE: case LUA_T_CLMARK: 97 case LUA_T_LINE: case LUA_T_CLMARK:
98 case LUA_T_CMARK: case LUA_T_PMARK: 98 case LUA_T_CMARK: case LUA_T_PMARK:
99 lua_error("internal error"); 99 LUA_INTERNALERROR("invalid type");
100#endif 100#endif
101 default: /* nil, number or cproto */ 101 default: /* nil, number or cproto */
102 return 1; 102 return 1;
@@ -212,11 +212,13 @@ static void hashmark (Hash *h)
212static void globalmark (void) 212static void globalmark (void)
213{ 213{
214 TaggedString *g; 214 TaggedString *g;
215 for (g=(TaggedString *)L->rootglobal.next; g; g=(TaggedString *)g->head.next) 215 for (g=(TaggedString *)L->rootglobal.next; g; g=(TaggedString *)g->head.next){
216 LUA_ASSERT(g->constindex >= 0, "userdata in global list");
216 if (g->u.s.globalval.ttype != LUA_T_NIL) { 217 if (g->u.s.globalval.ttype != LUA_T_NIL) {
217 markobject(&g->u.s.globalval); 218 markobject(&g->u.s.globalval);
218 strmark(g); /* cannot collect non nil global variables */ 219 strmark(g); /* cannot collect non nil global variables */
219 } 220 }
221 }
220} 222}
221 223
222 224