Work around deep mutual recursion in Syntax::to_ocaml
commit5c97fe9dc1d358bead22866887da95763e2fd39d
authorLeo Osvald <leoo@fb.com>
Thu, 25 Jul 2019 21:41:57 +0000 (25 14:41 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 25 Jul 2019 21:57:07 +0000 (25 14:57 -0700)
tree7f24c195ec4f4a9d95ce97621c897f2eee37f250
parenteacad989707a0a2fdd4de16c68f638c872e6fc96
Work around deep mutual recursion in Syntax::to_ocaml

Summary:
Assume that to-OCaml value syntax tree node serialization
requires ~2.5x more stack space than parsing, which is almost true in
debug mode (because Rust puts intermediate of *each* branch on stack).

Also, panic if the stack limit is ever exceeded, to prevent OOM.

Reviewed By: shiqicao

Differential Revision: D16473535

fbshipit-source-id: 67f1b79c1133442867755cce9ac8810336ff4dab
hphp/hack/src/parser/rust_parser_ffi.rs