aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-07 20:39:09 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-12-07 20:39:09 -0800
commit51480ab006fe32fae1d717d70aea1147190845e5 (patch)
tree4d7e341e9b7ebc0308fd525bdc6e0a122e08dcdb /src/library.js
parentd2f19271a1aaa96a938a3cef6d65f15e934555a0 (diff)
rewrite setjmp code to identify, uniquely, each setjmp and match it to a longjmp. add testcase for #747, works in unoptimized builds
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js
index 5a8a9ae7..1bdd840d 100644
--- a/src/library.js
+++ b/src/library.js
@@ -5940,11 +5940,11 @@ LibraryManager.library = {
setjmp__inline: function(env) {
// Save the label
- return '(setjmped = true, ' + makeSetValue(env, '0', 'label', 'i32') + ', 0)';
+ return '(tempInt = setjmpId++, mySetjmpIds[tempInt] = 1, setjmpLabels[tempInt] = label,' + makeSetValue(env, '0', 'tempInt', 'i32') + ', 0)';
},
longjmp: function(env, value) {
- throw { longjmp: true, label: {{{ makeGetValue('env', '0', 'i32') }}}, value: value || 1 };
+ throw { longjmp: true, id: {{{ makeGetValue('env', '0', 'i32') }}}, value: value || 1 };
},
// ==========================================================================