aboutsummaryrefslogtreecommitdiff
path: root/src/preamble.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/preamble.js')
-rw-r--r--src/preamble.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 710b7c52..832ec2c3 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -642,6 +642,10 @@ Module['stringToUTF32'] = stringToUTF32;
function demangle(func) {
try {
+ // Special-case the entry point, since its name differs from other name mangling.
+ if (func == 'Object._main' || func == '_main') {
+ return 'main()';
+ }
if (typeof func === 'number') func = Pointer_stringify(func);
if (func[0] !== '_') return func;
if (func[1] !== '_') return func; // C function