mstange / msvc-demangler-rust

A rust library that demangles / undecorates C++ symbols mangled by MSVC
Other
42 stars 13 forks source link

Backreference Handling Incorrect #54

Open mitsuhiko opened 5 years ago

mitsuhiko commented 5 years ago

The backtracking is definitely wrong but I'm not sure yet what the best way to fix it is. LLVM passes some flags through to indicate which parts of the symbols are supposed to be memoized. In particular an area we currently fail is that we do not handle template names correctly here.

The last testcase in the backreference example shows the issue quite well:

??$forward@P8?$DecoderStream@$01@media@@AEXXZ@std@@YA$$QAP8?$DecoderStream@$01@media@@AEXXZAAP812@AEXXZ@Z

The string references 12 at the end which should expand into media::DecoderStream<2> but don't at all in our case because we memoize the wrong things.