Skip to content

Commit

Permalink
further increase recursion limits
Browse files Browse the repository at this point in the history
this can now support some extreme cases like typesystem-level linked lists.
the usefulness of such might be questionable, but they *are* valid types.
  • Loading branch information
Swatinem committed Jul 23, 2020
1 parent d479a06 commit 80ad65b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
}
}
Expand Down Expand Up @@ -583,7 +583,7 @@ where
) -> DemangleContext<'a, W> {
DemangleContext {
subs: subs,
max_recursion: 128,
max_recursion: 160,
inner: vec![],
input: input,
source_name: None,
Expand Down
5 changes: 5 additions & 0 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,3 +569,8 @@ demangles!(
_ZNK8xxxxxxxx14xxxxxxxxxxxxxxINS_14xxxxxxxxxxxxxxINS1_INS1_INS1_INS1_INS1_INS_10xxxxxxxxxxE32xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxEES3_EE22xxxxxxxxxxxxxxxxxxxxxxEES6_EE13xxxxxxxxxxxxxEE17xxxxxxxxxxxxxxxxxEE14xxxxxxxxxxxxxxE8xxxxxxxxE7xxxxxxxRKN4xxxx5xxxxxEb,
"xxxxxxxx::xxxxxxxxxxxxxx<xxxxxxxx::xxxxxxxxxxxxxx<xxxxxxxx::xxxxxxxxxxxxxx<xxxxxxxx::xxxxxxxxxxxxxx<xxxxxxxx::xxxxxxxxxxxxxx<xxxxxxxx::xxxxxxxxxxxxxx<xxxxxxxx::xxxxxxxxxxxxxx<xxxxxxxx::xxxxxxxxxx, xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>, 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<int, long, unsigned int, double, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::basic_string_view<char, std::char_traits<char> >, long, unsigned long, long long, unsigned long long, boost::filesystem::path>::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(boost::enable_if<boost::mpl::or_<boost::mpl::and_<boost::is_rvalue_reference<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&>, boost::mpl::not_<boost::is_const<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, boost::mpl::not_<boost::is_same<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<int, long, unsigned int, double, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::basic_string_view<char, std::char_traits<char> >, long, unsigned long, long long, unsigned long long, boost::filesystem::path> > >, boost::detail::variant::is_variant_constructible_from<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, boost::mpl::l_item<mpl_::long_<(long)12>, int, boost::mpl::l_item<mpl_::long_<(long)11>, long, boost::mpl::l_item<mpl_::long_<(long)10>, unsigned int, boost::mpl::l_item<mpl_::long_<(long)9>, double, boost::mpl::l_item<mpl_::long_<(long)8>, bool, boost::mpl::l_item<mpl_::long_<(long)7>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::mpl::l_item<mpl_::long_<(long)6>, boost::basic_string_view<char, std::char_traits<char> >, boost::mpl::l_item<mpl_::long_<(long)5>, long, boost::mpl::l_item<mpl_::long_<(long)4>, unsigned long, boost::mpl::l_item<mpl_::long_<(long)3>, long long, boost::mpl::l_item<mpl_::long_<(long)2>, unsigned long long, boost::mpl::l_item<mpl_::long_<(long)1>, boost::filesystem::path, boost::mpl::l_end> > > > > > > > > > > > >, mpl_::bool_<true> >, boost::is_same<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::recursive_variant_>, mpl_::bool_<false>, mpl_::bool_<false>, mpl_::bool_<false> >, void>::type*)"
);

0 comments on commit 80ad65b

Please sign in to comment.