mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
Bug 1331444 - Keep iterators alive in Ion in for-of loops for IteratorClose due to exceptions
Issue #74
This commit is contained in:
parent
66bbc277f5
commit
082451c781
3 changed files with 22 additions and 6 deletions
7
js/src/jit-test/tests/for-of/bug-1331444.js
Normal file
7
js/src/jit-test/tests/for-of/bug-1331444.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// |jit-test| error: ReferenceError
|
||||
|
||||
symbols = [Symbol];
|
||||
for (comparator of[, ])
|
||||
for (a of symbols)
|
||||
for (;;)
|
||||
expect;
|
||||
|
|
@ -961,11 +961,16 @@ IonBuilder::processIterators()
|
|||
// Find phis that must directly hold an iterator live.
|
||||
Vector<MPhi*, 0, SystemAllocPolicy> worklist;
|
||||
for (size_t i = 0; i < iterators_.length(); i++) {
|
||||
MInstruction* ins = iterators_[i];
|
||||
for (MUseDefIterator iter(ins); iter; iter++) {
|
||||
if (iter.def()->isPhi()) {
|
||||
if (!worklist.append(iter.def()->toPhi()))
|
||||
return false;
|
||||
MDefinition* def = iterators_[i];
|
||||
if (def->isPhi()) {
|
||||
if (!worklist.append(def->toPhi()))
|
||||
return false;
|
||||
} else {
|
||||
for (MUseDefIterator iter(def); iter; iter++) {
|
||||
if (iter.def()->isPhi()) {
|
||||
if (!worklist.append(iter.def()->toPhi()))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1936,6 +1941,10 @@ IonBuilder::inspectOpcode(JSOp op)
|
|||
case JSOP_CALLITER:
|
||||
case JSOP_NEW:
|
||||
case JSOP_SUPERCALL:
|
||||
if (op == JSOP_CALLITER) {
|
||||
if (!outermostBuilder()->iterators_.append(current->peek(-1)))
|
||||
return false;
|
||||
}
|
||||
return jsop_call(GET_ARGC(pc), (JSOp)*pc == JSOP_NEW || (JSOp)*pc == JSOP_SUPERCALL);
|
||||
|
||||
case JSOP_EVAL:
|
||||
|
|
|
|||
|
|
@ -1242,7 +1242,7 @@ class IonBuilder
|
|||
Vector<ControlFlowInfo, 4, JitAllocPolicy> loops_;
|
||||
Vector<ControlFlowInfo, 0, JitAllocPolicy> switches_;
|
||||
Vector<ControlFlowInfo, 2, JitAllocPolicy> labels_;
|
||||
Vector<MInstruction*, 2, JitAllocPolicy> iterators_;
|
||||
Vector<MDefinition*, 2, JitAllocPolicy> iterators_;
|
||||
Vector<LoopHeader, 0, JitAllocPolicy> loopHeaders_;
|
||||
BaselineInspector* inspector;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue