Ensure that coroutines are not re-entered if their state is not saved
commit9abb78f66455120274274d38650df06851a8713e
authorMichael Tingley <tingley@fb.com>
Thu, 28 Sep 2017 17:26:30 +0000 (28 10:26 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 28 Sep 2017 17:33:35 +0000 (28 10:33 -0700)
treeadfa9d91e12f0762bb68ce4044df506c23a362cf
parent867765c9191d02c13e12eb517ab01a2f467e5423
Ensure that coroutines are not re-entered if their state is not saved

Summary: This diff introduces a simple guard around the `doResume` method of `ClosureBase`. It ensures that a particular coroutine instance's `doResume` method is //not// (recursively) called if the call stack is //already in// the `doResume` method. This will guarantee that the coroutine may only be entered if its state is up-to-date.

Reviewed By: vladima

Differential Revision: D5841888

fbshipit-source-id: 8ca4ba3a88a8ad6d803248d8fe5b565d294e38dd
hphp/hack/src/parser/coroutine/coroutine_method_lowerer.ml
hphp/hack/src/parser/coroutine/coroutine_syntax.ml