From 590bf1be88fc8516f5eb84051cea8ad9452b052d Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Fri, 6 Apr 2007 00:50:06 +0200 Subject: [PATCH] msvcrt: Demangle a C++ mangled string that is only a name with it's template argument list. --- dlls/msvcrt/tests/cpp.c | 3 +++ dlls/msvcrt/undname.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c index 1d435028df0..370a348481f 100644 --- a/dlls/msvcrt/tests/cpp.c +++ b/dlls/msvcrt/tests/cpp.c @@ -975,6 +975,9 @@ static void test_demangle(void) {"??0aa$_3a@@QAE@XZ", "public: __thiscall aa$_3a::aa$_3a(void)"}, {"??2?$aaa@AAUbbb@@AAUccc@@AAU2@@ddd@1eee@2@QAEHXZ", "public: int __thiscall eee::eee::ddd::ddd::aaa::operator new(void)"}, {"?pSW@@3P6GHKPAX0PAU_tagSTACKFRAME@@0P6GH0K0KPAK@ZP6GPAX0K@ZP6GK0K@ZP6GK00PAU_tagADDRESS@@@Z@ZA", "int (__stdcall* pSW)(unsigned long,void *,void *,struct _tagSTACKFRAME *,void *,int (__stdcall*)(void *,unsigned long,void *,unsigned long,unsigned long *),void * (__stdcall*)(void *,unsigned long),unsigned long (__stdcall*)(void *,unsigned long),unsigned long (__stdcall*)(void *,void *,struct _tagADDRESS *))"}, +{"?$_aaa@Vbbb@@", "_aaa"}, +{"??$_aaa@Vbbb@@", "??$_aaa@Vbbb@@"}, +{"?$aaa@Vbbb@ccc@@Vddd@2@", "aaa"}, }; int i, num_test = (sizeof(test)/sizeof(test[0])); char* name; diff --git a/dlls/msvcrt/undname.c b/dlls/msvcrt/undname.c index da4aeb0d3b5..a16d3d8e9ca 100644 --- a/dlls/msvcrt/undname.c +++ b/dlls/msvcrt/undname.c @@ -1156,6 +1156,15 @@ static BOOL symbol_demangle(struct parsed_symbol* sym) } sym->stack.start = 1; } + else if (*sym->current == '$') + { + /* Strange construct, it's a name with a template argument list + and that's all. */ + sym->current++; + sym->result = get_template_name(sym); + ret = TRUE; + goto done; + } /* Either a class name, or '@' if the symbol is not a class member */ if (*sym->current != '@')