Fix crash related to lazy rules and async blocks
commitfe06120b0818aeafdd0bccd1e959f471399ff061
authorEric Shrewsberry <eshrews@fb.com>
Mon, 10 Apr 2017 20:30:26 +0000 (10 13:30 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Mon, 10 Apr 2017 20:33:54 +0000 (10 13:33 -0700)
treef7d904e768877961fcef0bb54bb56807740faaa1
parent03d36d4a66e8e69059fc033ebb64a9a037508074
Fix crash related to lazy rules and async blocks

Summary:
async blocks can be used as the left-hand side of the pipe operator.

The problem was we were ending the chunk group at the end of the async block even though the chunk group should also contain the right-hand side of the pipe operator. Since binary operators use lazy rules, and lazy rules don't persist across chunk groups, the code was trying to look up a rule that was in the previous chunk group, leading to fatals.

This code fixes that problem

Differential Revision: D4856571

fbshipit-source-id: bf7589736ecabc8b655655b9b430ce8dd43d90bd
hphp/hack/src/hackfmt/chunk_builder.ml
hphp/hack/src/hackfmt/hack_format.ml
hphp/hack/test/hackfmt/tests/awaitable_creation_expressions.php [new file with mode: 0644]
hphp/hack/test/hackfmt/tests/awaitable_creation_expressions.php.exp [new file with mode: 0644]