Generate properly synced catch block for IterInit
Summary:
IterInit bytecode discards a stack value containing the iterable and then emits
an IterInit IR opcode that consumes it. The problem is that there was no
exception stack boundary between these two operations, so we emitted a catch
block with an incorrectly synced stack offsets. This forced us to preserve the
iterable across the opcode, so that the catch block can sync it to the stack.
This did not cause any real issues until now because of super hacky fixup logic
that synced the SP properly, so the unwindier did not attempt to decref this
extra value. However, oulgen's unwinder improvements experience this issue and
free the iterable twice.
Fix this by syncing the boundary and removing the hacky fixup logic. I will try
to improve the enforcement of this situation in the next diff, which is likely
to catch more instances of this bug.
Reviewed By: ricklavoie, oulgen
Differential Revision:
D20524184
fbshipit-source-id:
7d571115fd1f6aad293aa6c2b6edabc173dc6cd8