aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2011-01-22 20:32:23 +0100
committerMike Pall <mike>2011-01-22 20:32:23 +0100
commitf529d22869429d458c5382cf6787f213d7bd5296 (patch)
tree54c17195b7a88a67907daffbc94caed4387b63a5 /src
parente985aeda84d8af63c4bfaa176c3312dfb2f7f230 (diff)
downloadluajit-f529d22869429d458c5382cf6787f213d7bd5296.tar.gz
luajit-f529d22869429d458c5382cf6787f213d7bd5296.tar.bz2
luajit-f529d22869429d458c5382cf6787f213d7bd5296.zip
Another fix for the trace flush logic. I'll get this right someday.
Thanks to David Manura.
Diffstat (limited to 'src')
-rw-r--r--src/lj_trace.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lj_trace.c b/src/lj_trace.c
index c6e87bb5..612a41bc 100644
--- a/src/lj_trace.c
+++ b/src/lj_trace.c
@@ -194,8 +194,9 @@ static void trace_unpatch(jit_State *J, GCtrace *T)
194 lua_assert(bc_op(*pc) == BC_JFORI); 194 lua_assert(bc_op(*pc) == BC_JFORI);
195 setbc_op(pc, BC_FORI); 195 setbc_op(pc, BC_FORI);
196 break; 196 break;
197 case BC_JITERL:
197 case BC_JLOOP: 198 case BC_JLOOP:
198 lua_assert(op == BC_LOOP || bc_isret(op)); 199 lua_assert(op == BC_ITERL || op == BC_LOOP || bc_isret(op));
199 *pc = T->startins; 200 *pc = T->startins;
200 break; 201 break;
201 case BC_JMP: 202 case BC_JMP:
@@ -227,11 +228,13 @@ static void trace_flushroot(jit_State *J, GCtrace *T)
227 pt->trace = T->nextroot; 228 pt->trace = T->nextroot;
228 } else { /* Otherwise search in chain of root traces. */ 229 } else { /* Otherwise search in chain of root traces. */
229 GCtrace *T2 = traceref(J, pt->trace); 230 GCtrace *T2 = traceref(J, pt->trace);
230 for (; T2->nextroot; T2 = traceref(J, T2->nextroot)) 231 if (T2) {
231 if (T2->nextroot == T->traceno) { 232 for (; T2->nextroot; T2 = traceref(J, T2->nextroot))
232 T2->nextroot = T->nextroot; /* Unlink from chain. */ 233 if (T2->nextroot == T->traceno) {
233 break; 234 T2->nextroot = T->nextroot; /* Unlink from chain. */
234 } 235 break;
236 }
237 }
235 } 238 }
236} 239}
237 240