Fixed accidentally trying to trace compile a recursive generator (bug 529130, r=gal).

This commit is contained in:
David Anderson 2009-11-18 12:41:51 -05:00
parent e4ee1ce1bf
commit 20ee309b48
2 changed files with 21 additions and 0 deletions

View File

@ -9646,6 +9646,8 @@ IsTraceableRecursion(JSContext *cx)
return false;
if ((fp->flags & JSFRAME_CONSTRUCTING) || (down->flags & JSFRAME_CONSTRUCTING))
return false;
if (*fp->script->code != JSOP_TRACE)
return false;
return true;
}

View File

@ -0,0 +1,19 @@
// don't crash
var q = 30;
function var_iter(v) {
q--;
yield v;
if (q > 0) {
for each (let ret in var_iter(v)) {
var_iter(v);
yield ret;
}
}
}
for (x in var_iter([1, 2, 3, 4, 5, 6, 7, 8, 9]))
print(x);