aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2010-09-15 01:13:07 +0200
committerMike Pall <mike>2010-09-15 01:13:07 +0200
commit44702720c577d80c75e90c030af30557aa430e5c (patch)
treeea03db112336be1d93a8ab58a3afb79a58eef0aa
parent77267bc5384b4211418a05f0897ff336c4e1279e (diff)
downloadluajit-44702720c577d80c75e90c030af30557aa430e5c.tar.gz
luajit-44702720c577d80c75e90c030af30557aa430e5c.tar.bz2
luajit-44702720c577d80c75e90c030af30557aa430e5c.zip
Don't traverse inactive GCtrace objects.
-rw-r--r--src/lj_gc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lj_gc.c b/src/lj_gc.c
index e76175fc..75871a2d 100644
--- a/src/lj_gc.c
+++ b/src/lj_gc.c
@@ -230,6 +230,7 @@ static void gc_marktrace(global_State *g, TraceNo traceno)
230static void gc_traverse_trace(global_State *g, GCtrace *T) 230static void gc_traverse_trace(global_State *g, GCtrace *T)
231{ 231{
232 IRRef ref; 232 IRRef ref;
233 if (T->traceno == 0) return;
233 for (ref = T->nk; ref < REF_TRUE; ref++) { 234 for (ref = T->nk; ref < REF_TRUE; ref++) {
234 IRIns *ir = &T->ir[ref]; 235 IRIns *ir = &T->ir[ref];
235 if (ir->o == IR_KGC) 236 if (ir->o == IR_KGC)
@@ -242,8 +243,7 @@ static void gc_traverse_trace(global_State *g, GCtrace *T)
242} 243}
243 244
244/* The current trace is a GC root while not anchored in the prototype (yet). */ 245/* The current trace is a GC root while not anchored in the prototype (yet). */
245#define gc_traverse_curtrace(g) \ 246#define gc_traverse_curtrace(g) gc_traverse_trace(g, &G2J(g)->cur)
246 { if (G2J(g)->cur.traceno != 0) gc_traverse_trace(g, &G2J(g)->cur); }
247#else 247#else
248#define gc_traverse_curtrace(g) UNUSED(g) 248#define gc_traverse_curtrace(g) UNUSED(g)
249#endif 249#endif