Eric Pouech : msvcrt: Fixed symbol unmangling for template-parameter-?? form, as well as test.

Alexandre Julliard julliard at winehq.org
Tue Apr 29 08:54:25 CDT 2008


Module: wine
Branch: master
Commit: a940218c0b5b64f638b0e1678024659cd77e2089
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a940218c0b5b64f638b0e1678024659cd77e2089

Author: Eric Pouech <eric.pouech at orange.fr>
Date:   Mon Apr 28 21:18:20 2008 +0200

msvcrt: Fixed symbol unmangling for template-parameter-?? form, as well as test.

Spotted by James Hawkins.

---

 dlls/msvcrt/tests/cpp.c |    2 +-
 dlls/msvcrt/undname.c   |   11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c
index 2788a56..5daa4cc 100644
--- a/dlls/msvcrt/tests/cpp.c
+++ b/dlls/msvcrt/tests/cpp.c
@@ -982,7 +982,7 @@ static void test_demangle(void)
 { "?Qux at Bar@@0PAP6AHPAV1 at AAH1PAH@ZA", "private: static int (__cdecl** Bar::Qux)(class Bar *,int &,int &,int *)" },
 { "?Qux at Bar@@0PAP6AHPAV1 at AAH1PAH@ZA", "Bar::Qux", 0x1800},
 {"?$AAA@$DBAB@", "AAA<`template-parameter257'>"},
-{"?$AAA@$D?4@", "AAA<`template-parameter-5'>"},
+{"?$AAA@?C@", "AAA<`template-parameter-2'>"},
 {"?$AAA at PAUBBB@@", "AAA<struct BBB *>"},
 {"??$ccccc at PAVaaa@@@bar at bb@foo@@DGPAV0 at PAV0@PAVee@@IPAPAVaaa@@1 at Z", "private: static class bar * __stdcall foo::bb::bar::ccccc<class aaa *>(class bar *,class ee *,unsigned int,class aaa **,class ee *)"},
     };
diff --git a/dlls/msvcrt/undname.c b/dlls/msvcrt/undname.c
index 93030b2..f115dca 100644
--- a/dlls/msvcrt/undname.c
+++ b/dlls/msvcrt/undname.c
@@ -759,7 +759,16 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
         break;
     case '?':
         /* not all the time is seems */
-        if (!get_modified_type(ct, sym, pmt_ref, '?')) goto done;
+        if (in_args)
+        {
+            const char*   ptr;
+            if (!(ptr = get_number(sym))) goto done;
+            ct->left = str_printf(sym, "`template-parameter-%s'", ptr);
+        }
+        else
+        {
+            if (!get_modified_type(ct, sym, pmt_ref, '?')) goto done;
+        }
         break;
     case 'A': /* reference */
     case 'B': /* volatile reference */




More information about the wine-cvs mailing list