Bug 1357075 - Pad a nop to unwind to the scope just before a destructuring iterator close trynote

Issue #74
This commit is contained in:
janekptacijarabaci 2018-03-25 18:24:06 +02:00 • committed by Roy Tam
commit ac07311b18
7 changed files with 43 additions and 5 deletions

View file

@ -5318,6 +5318,14 @@ BytecodeEmitter::wrapWithDestructuringIteratorCloseTryNote(int32_t iterDepth, In
{
MOZ_ASSERT(this->stackDepth >= iterDepth);
// Pad a nop at the beginning of the bytecode covered by the trynote so
// that when unwinding environments, we may unwind to the scope
// corresponding to the pc *before* the start, in case the first bytecode
// emitted by |emitter| is the start of an inner scope. See comment above
// UnwindEnvironmentToTryPc.
if (!emit1(JSOP_TRY_DESTRUCTURING_ITERCLOSE))
return false;
ptrdiff_t start = offset();
if (!emitter(this))
return false;