diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-04-23 18:26:32 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-04-23 18:26:32 -0700 |
commit | 5b300b8e00e089ad9c5eba04738632b39f9002a0 (patch) | |
tree | 2d9c9f7f27bb576e2facc1e0ce214f5be5a02ac5 /src | |
parent | 7bba036d79ee219f46402cd914504adf5a199230 (diff) |
properly coerce setjmp helpers
Diffstat (limited to 'src')
-rw-r--r-- | src/jsifier.js | 2 | ||||
-rw-r--r-- | src/library.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index fb761b18..30a06d76 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1481,7 +1481,7 @@ function JSify(data, functionsOnly, givenFunctions) { if (ASM_JS && funcData.setjmpTable) { // 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'; + ret += '; if (((__THREW__|0) != 0) & ((threwValue|0) > 0)) { setjmpLabel = ' + asmCoercion('_testSetjmp(' + makeGetValue('__THREW__', 0, 'i32') + ', setjmpTable)', 'i32') + '; if ((setjmpLabel|0) > 0) { label = -1111; break } else return ' + (funcData.returnType != 'void' ? asmCoercion('0', funcData.returnType) : '') + ' } __THREW__ = threwValue = 0;\n'; } return ret; diff --git a/src/library.js b/src/library.js index 91270c38..daba0611 100644 --- a/src/library.js +++ b/src/library.js @@ -6272,7 +6272,7 @@ LibraryManager.library = { setjmp__inline: function(env) { // Save the label #if ASM_JS - return '_saveSetjmp(' + env + ', label, setjmpTable)'; + return '_saveSetjmp(' + env + ', label, setjmpTable)|0'; #else return '(tempInt = setjmpId++, mySetjmpIds[tempInt] = 1, setjmpLabels[tempInt] = label,' + makeSetValue(env, '0', 'tempInt', 'i32', undefined, undefined, undefined, undefined, ',') + ', 0)'; #endif |