Add MSVC demangler correctness fixes and generated test corpus#8140
Draft
Add MSVC demangler correctness fixes and generated test corpus#8140
Conversation
3ee5290 to
6b58d2e
Compare
Fix demangler backrefs and type-node formatting Fix MSVC demangler parsing for scoped backrefs, template and local-name contexts, member pointers, enum signedness, varargs, RTTI names, thunks, and pointer/function modifier edge cases. Update shared demangled type-node construction and GNU3 pointer suffix formatting so demangled types produce stable type/name strings without encoding invalid intermediate types. Fix MSVC member function pointer demangling Parse P8 member function pointer types as member pointers instead of plain function pointers, preserving the owning class in the demangled type node. Keep finalization returning a real Type so callers retain callable type information, even though Binary Ninja cannot represent exact C++ member function pointer declarator placement. Move implicit this handling into DemangledTypeNode finalization so top-level function Types receive a synthetic this parameter, while stringified nested/template symbols omit it. Also tighten nested function pointer parsing so implicit this is not added to function pointer parameter and return types.
6b58d2e to
4b906ea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is quite a substantial refactor of the msvc demangler which solves pretty much all known de
mangler accuracy issues.
Major changes:
to provide an abstraction layer between c++ features and binary
ninja's type objects.
this is due to cutting down on extraneous string copies and type object allocations
of back references.
I didn't feel that adding all those commits would be helpful in understanding what's
actually going on here.
Fixes: