diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/intertyper.js | 1 | ||||
-rw-r--r-- | src/jsifier.js | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/intertyper.js b/src/intertyper.js index 7db1a2fe..1d18c3cf 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -919,6 +919,7 @@ function intertyper(data, sidePass, baseLineNums) { processItem: function(item) { return [{ intertype: 'resume', + ident: toNiceIdent(item.tokens[2].text), lineNum: item.lineNum }]; } diff --git a/src/jsifier.js b/src/jsifier.js index 8b3c9683..47118d76 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1036,8 +1036,12 @@ function JSify(data, functionsOnly, givenFunctions) { return ret + ';'; }); makeFuncLineActor('resume', function(item) { + // exception pointer is from the ident (we can't reuse it from the original exception since cxa_end_catch might clean it up); + // type and destructor can be reused. return (EXCEPTION_DEBUG ? 'Module.print("Resuming exception");' : '') + - 'throw ' + makeGetValue('_llvm_eh_exception.buf', '0', 'void*') + ';'; + '___cxa_throw(' + item.ident + '.f0, ' + + makeGetValue('_llvm_eh_exception.buf', Runtime.QUANTUM_SIZE, 'void*') + ',' + + makeGetValue('_llvm_eh_exception.buf', Runtime.QUANTUM_SIZE*2, 'void*') + ');'; }); makeFuncLineActor('invoke', function(item) { // Wrapping in a function lets us easily return values if we are |