aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jsifier.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 926be71a..a4dd797b 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1210,6 +1210,12 @@ function JSify(data, functionsOnly, givenFunctions) {
}
});
makeFuncLineActor('landingpad', function(item) {
+ if (DISABLE_EXCEPTION_CATCHING && USE_TYPED_ARRAYS == 2) {
+ ret = makeVarDef(item.assignTo) + '$0 = 0; ' + item.assignTo + '$1 = 0;';
+ item.assignTo = null;
+ if (ASSERTIONS) warnOnce('landingpad, but exceptions are disabled!');
+ return ret;
+ }
var catchTypeArray = item.catchables.map(finalizeLLVMParameter).map(function(element) { return asmCoercion(element, 'i32') }).join(',');
var ret = asmCoercion('___cxa_find_matching_catch(-1, -1' + (catchTypeArray.length > 0 ? ',' + catchTypeArray : '') +')', 'i32');
if (USE_TYPED_ARRAYS == 2) {
@@ -1458,11 +1464,12 @@ function JSify(data, functionsOnly, givenFunctions) {
});
makeFuncLineActor('unreachable', function(item) {
+ var ret = '';
+ if (ASM_JS && item.funcData.returnType != 'void') ret = 'return ' + asmCoercion('0', item.funcData.returnType) + ';';
if (ASSERTIONS) {
- return ASM_JS ? 'abort()' : 'throw "Reached an unreachable!"';
- } else {
- return ';';
+ ret = (ASM_JS ? 'abort()' : 'throw "Reached an unreachable!"') + ';' + ret;
}
+ return ret || ';';
});
// Final combiner