diff options
-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 |