Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to specify a maximum length for the demangled symbol #53

Open
fitzgen opened this issue Feb 19, 2017 · 2 comments
Open

Allow users to specify a maximum length for the demangled symbol #53

fitzgen opened this issue Feb 19, 2017 · 2 comments

Comments

@fitzgen
Copy link
Member

fitzgen commented Feb 19, 2017

Since the demangled symbol's length can be exponential in the worst case, we should allow users to clamp it down.

For example, this mangled symbol

__Z20lets_get_exponentialP4PairIS_IS_IS_IS_IS_IS_IS_IiiES0_ES1_ES2_ES3_ES4_ES5_ES6_E

Demangles into this:

lets_get_exponential(Pair<Pair<Pair<Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > >, Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > > >, Pair<Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > >, Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > > > >, Pair<Pair<Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > >, Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > > >, Pair<Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > >, Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > > > > >*)
@crepererum
Copy link

@fitzgen
Copy link
Member Author

fitzgen commented Aug 28, 2018

FWIW, one can do this now with a custom Write impl wrapper to demangle into that enforces a max number of bytes to forward to its underlying writer and errors if anything attempts to write more than that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants