Skip to content

Custom PEGTL parse tree without unwind support

Compare
Choose a tag to compare
@wravery wravery released this 18 May 05:14
· 144 commits to main since this release
b8edf5f

Till the try/catch/rethrow handling is fixed in the PEGTL version of parse_tree, throwing an exception during parsing easily overflows the stack on Windows with MSVC. This change brings a simplified version of the PEGTL parse_tree into cppgraphqlgen without support for the unwind feature (which cppgraphqlgen doesn't use), so it no longer needs to handle the exceptions at each level of the tree. It just lets them be caught directly in the caller after destroying all of the objects on the stack.

The short version is that this should fix #222 using the default depth limit of 25 (or even up to ~100) rather than needing to set it to something less than 10. If/when PEGTL is updated to remove the try/catch/rethrow implementation, cppgraphqlgen can revert to using the original version of parse_tree in PEGTL.

This version also updates the PEGTL sub-module and find_package call in CMake to use 3.2.6, which has some fixes for recent versions of both MSVC and GCC. If you have a CI build which uses cppgraphqlgen and PEGTL (e.g. from vcpkg), you may have noticed that it broke recently when Visual Studio was updated. This should fix that, too.

What's Changed

  • Customize the PEGTL parse_tree implementation by @wravery in #252

Full Changelog: v4.4.0...v4.4.1