diff options
-rw-r--r-- | src/compiler.js | 2 | ||||
-rw-r--r-- | src/jsifier.js | 2 | ||||
-rw-r--r-- | src/utility.js | 9 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/compiler.js b/src/compiler.js index f461bcf7..bb72c7dd 100644 --- a/src/compiler.js +++ b/src/compiler.js @@ -168,7 +168,7 @@ if (SAFE_HEAP >= 2) { EXPORTED_FUNCTIONS = set(EXPORTED_FUNCTIONS); EXPORTED_GLOBALS = set(EXPORTED_GLOBALS); EXCEPTION_CATCHING_WHITELIST = set(EXCEPTION_CATCHING_WHITELIST); -DEAD_FUNCTIONS = set(DEAD_FUNCTIONS); +DEAD_FUNCTIONS = numberedSet(DEAD_FUNCTIONS); RUNTIME_DEBUG = LIBRARY_DEBUG || GL_DEBUG; diff --git a/src/jsifier.js b/src/jsifier.js index d36f26ce..3cb5c23e 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1420,7 +1420,7 @@ function JSify(data, functionsOnly, givenFunctions) { } if (callIdent in DEAD_FUNCTIONS) { - var ret = 'abort(7)'; + var ret = 'abort(' + DEAD_FUNCTIONS[callIdent] + ')'; if (ASM_JS) ret = asmCoercion(ret, returnType); return ret; } diff --git a/src/utility.js b/src/utility.js index 8db37c61..19444675 100644 --- a/src/utility.js +++ b/src/utility.js @@ -267,6 +267,15 @@ function set() { } var unset = keys; +function numberedSet() { + var args = typeof arguments[0] === 'object' ? arguments[0] : arguments; + var ret = {}; + for (var i = 0; i < args.length; i++) { + ret[args[i]] = i; + } + return ret; +} + function setSub(x, y) { var ret = set(keys(x)); for (yy in y) { |