aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-18 21:39:22 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-18 21:39:22 -0700
commit5bdc1a5bab4a14a9970fb53be603989a57a3a67b (patch)
tree4e8a8329fef3cd39ca8bf79f5a43e68b615c80bc /src/jsifier.js
parent93e4ae68d6263556f6bd2dfd4ffc9f1377ada7ce (diff)
exit to caller when setjmp encounters an id that is not ours; enable test_longjmp2 and 3 in asm
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 7086922c..ea1289c6 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1473,8 +1473,9 @@ function JSify(data, functionsOnly, givenFunctions) {
}
if (ASM_JS && funcData.setjmpTable) {
- // check if a longjmp was done
- ret += '; if (((__THREW__|0) != 0) & ((threwValue|0) > 0)) { setjmpLabel = _testSetjmp(' + makeGetValue('__THREW__', 0, 'i32') + ', setjmpTable); if ((setjmpLabel|0) > 0) { label = -1111; break } } __THREW__ = threwValue = 0;\n';
+ // check if a longjmp was done. If a setjmp happened, check if ours. If ours, go to -111 to handle it.
+ // otherwise, just return - the call to us must also have been an invoke, so the setjmp propagates that way
+ ret += '; if (((__THREW__|0) != 0) & ((threwValue|0) > 0)) { setjmpLabel = _testSetjmp(' + makeGetValue('__THREW__', 0, 'i32') + ', setjmpTable); if ((setjmpLabel|0) > 0) { label = -1111; break } else return ' + (funcData.returnType != 'void' ? asmCoercion('0', funcData.returnType) : '') + ' } __THREW__ = threwValue = 0;\n';
}
return ret;