From 80ad65bd891362a21f46e438a7ba41b9538181fb Mon Sep 17 00:00:00 2001 From: Arpad Borsos Date: Thu, 23 Jul 2020 14:35:27 +0200 Subject: [PATCH] further increase recursion limits this can now support some extreme cases like typesystem-level linked lists. the usefulness of such might be questionable, but they *are* valid types. --- src/ast.rs | 4 ++-- tests/tests.rs | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ast.rs b/src/ast.rs index 6498dda..82b68e8 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -177,7 +177,7 @@ pub struct ParseContext { impl Default for ParseContext { fn default() -> ParseContext { ParseContext { - max_recursion: 96, + max_recursion: 160, state: Cell::new(ParseContextState::default()), } } @@ -583,7 +583,7 @@ where ) -> DemangleContext<'a, W> { DemangleContext { subs: subs, - max_recursion: 128, + max_recursion: 160, inner: vec![], input: input, source_name: None, diff --git a/tests/tests.rs b/tests/tests.rs index 1071bfd..605e8fd 100755 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -569,3 +569,8 @@ demangles!( _ZNK8xxxxxxxx14xxxxxxxxxxxxxxINS_14xxxxxxxxxxxxxxINS1_INS1_INS1_INS1_INS1_INS_10xxxxxxxxxxE32xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxEES3_EE22xxxxxxxxxxxxxxxxxxxxxxEES6_EE13xxxxxxxxxxxxxEE17xxxxxxxxxxxxxxxxxEE14xxxxxxxxxxxxxxE8xxxxxxxxE7xxxxxxxRKN4xxxx5xxxxxEb, "xxxxxxxx::xxxxxxxxxxxxxx, xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>, xxxxxxxxxxxxxxxxxxxxxx>, xxxxxxxxxxxxxxxxxxxxxx>, xxxxxxxxxxxxx>, xxxxxxxxxxxxxxxxx>, xxxxxxxxxxxxxx>::xxxxxxxx(xxxxxxx, xxxx::xxxxx const&, bool) const" ); + +demangles!( + _ZN5boost7variantIiJljdbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_17basic_string_viewIcS4_EElmxyNS_10filesystem4pathEEEC2IS6_EEOT_PNS_9enable_ifINS_3mpl3or_INSG_4and_INS_19is_rvalue_referenceISE_EENSG_4not_INS_8is_constISD_EEEENSL_INS_7is_sameISD_SB_EEEENS_6detail7variant29is_variant_constructible_fromISE_NSG_6l_itemIN4mpl_5long_ILl12EEEiNSV_INSX_ILl11EEElNSV_INSX_ILl10EEEjNSV_INSX_ILl9EEEdNSV_INSX_ILl8EEEbNSV_INSX_ILl7EEES6_NSV_INSX_ILl6EEES8_NSV_INSX_ILl5EEElNSV_INSX_ILl4EEEmNSV_INSX_ILl3EEExNSV_INSX_ILl2EEEyNSV_INSX_ILl1EEESA_NSG_5l_endEEEEEEEEEEEEEEEEEEEEEEEEEEENSW_5bool_ILb1EEEEENSP_ISD_NS_18recursive_variant_EEENS1O_ILb0EEES1T_S1T_EEvE4typeE, + "boost::variant, std::allocator >, boost::basic_string_view >, long, unsigned long, long long, unsigned long long, boost::filesystem::path>::variant, std::allocator > >(boost::enable_if, std::allocator >&&>, boost::mpl::not_, std::allocator > > >, boost::mpl::not_, std::allocator >, boost::variant, std::allocator >, boost::basic_string_view >, long, unsigned long, long long, unsigned long long, boost::filesystem::path> > >, boost::detail::variant::is_variant_constructible_from, std::allocator >&&, boost::mpl::l_item, int, boost::mpl::l_item, long, boost::mpl::l_item, unsigned int, boost::mpl::l_item, double, boost::mpl::l_item, bool, boost::mpl::l_item, std::__cxx11::basic_string, std::allocator >, boost::mpl::l_item, boost::basic_string_view >, boost::mpl::l_item, long, boost::mpl::l_item, unsigned long, boost::mpl::l_item, long long, boost::mpl::l_item, unsigned long long, boost::mpl::l_item, boost::filesystem::path, boost::mpl::l_end> > > > > > > > > > > > >, mpl_::bool_ >, boost::is_same, std::allocator >, boost::recursive_variant_>, mpl_::bool_, mpl_::bool_, mpl_::bool_ >, void>::type*)" +); \ No newline at end of file