Add MSVC demangler correctness fixes and generated test corpus#8140
Add MSVC demangler correctness fixes and generated test corpus#8140plafosse wants to merge 4 commits into
Conversation
4b906ea to
15dd98a
Compare
1cd85f5 to
02cebd9
Compare
02cebd9 to
7862d28
Compare
| #endif | ||
|
|
||
|
|
||
| #define MAX_DEMANGLE_LENGTH 262144 |
There was a problem hiding this comment.
Any reason to remove the max length guard? I know the max nesting depth guard was added but that doesn't seem like it replaces this, and maximum length is a useful guardrail to have.
There was a problem hiding this comment.
We would need to stringify just to check the length this was a huge source of slow down in the old version
There was a problem hiding this comment.
Good point. It may still be worth having a length size check on individual nodes though. I'm not sure if the mangle format lets you specify token length in a way that would cause problems, but I wouldn't put it past it.
There was a problem hiding this comment.
Yeah, it might be worth it having a maximum node length
|
Also fixes #8230 as we switched to a nesting guard rather than stringification max length |
2eb0f36 to
40d903f
Compare
Parse MSVC symbols into structured type nodes before finalization. This keeps thunk suffixes, calling conventions, member pointers, and implicit this parameters dependent on the final platform/view context.
Use shared demangler type nodes for substitutions and nested names. This preserves structure for template arguments, expression arguments, argument packs, and lambda auto parameters instead of relying on stale formatted strings.
Share DemangledTypeNode across demangler implementations and add MAX_DEMANGLE_NODE_LENGTH for bounded formatting.
40d903f to
c553290
Compare
|
Merged in 5.4.9912 |
This should be considered a ground up re-write and so you probably won't get any value out of looking at diffs of the actual demangler. It pretty much solves all known demangler accuracy issues. And lays the ground work for more performance unlocks when we get the new simplifier integrated.
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: