diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-03-11 11:14:53 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-03-11 11:14:53 -0700 |
commit | 77e8b7dc65244ec83a53340394fd57f3632b317a (patch) | |
tree | 830d58a130339071be1d3077693a9d9e53f70e2c | |
parent | f69f770f7c9c9e1fff85b2ba0b89b512a5ab56ed (diff) |
improve demangler a little
-rw-r--r-- | src/preamble.js | 9 | ||||
-rw-r--r-- | tests/test_other.py | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/preamble.js b/src/preamble.js index 3f724562..89ab5026 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -805,7 +805,14 @@ function demangle(func) { } } if (!allowVoid && list.length === 1 && list[0] === 'void') list = []; // avoid (void) - return rawList ? list : ret + flushList(); + if (rawList) { + if (ret) { + list.push(ret + '?'); + } + return list; + } else { + return ret + flushList(); + } } try { // Special-case the entry point, since its name differs from other name mangling. diff --git a/tests/test_other.py b/tests/test_other.py index 3d5cef96..fcf7e49d 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -2104,6 +2104,7 @@ done. EM_ASM(Module.print(demangle('__Z5multiwahtjmxyz'))); EM_ASM(Module.print(demangle('__Z1aA32_iPA5_c'))); EM_ASM(Module.print(demangle('__ZN21FWakaGLXFleeflsMarfooC2EjjjPKvbjj'))); + EM_ASM(Module.print(demangle('__ZN5wakaw2Cm10RasterBaseINS_6watwat9PolocatorEE8merbine1INS4_2OREEEvPKjj'))); // we get this wrong, but at least emit a '?' one(17); return 0; } @@ -2127,6 +2128,7 @@ parseword(char*&, int, int&) multi(wchar_t, signed char, unsigned char, unsigned short, unsigned int, unsigned long, long long, unsigned long long, ...) a(int [32], char [5]*) FWakaGLXFleeflsMarfoo::FWakaGLXFleeflsMarfoo(unsigned int, unsigned int, unsigned int, void*, bool, unsigned int, unsigned int) +void wakaw::Cm::RasterBase<wakaw::watwat::Polocator?>(unsigned int*, unsigned int) ''', output) # test for multiple functions in one stack trace assert 'one(int)' in output |