diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/jsifier.js | 6 | ||||
-rw-r--r-- | src/library.js | 12 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 501ed3f9..b14c213f 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -926,7 +926,8 @@ function JSify(data, functionsOnly, givenFunctions) { return ret + ';'; }); makeFuncLineActor('resume', function(item) { - return (EXCEPTION_DEBUG ? 'print("Resuming exception");' : '') + 'throw [0,0];'; + return (EXCEPTION_DEBUG ? 'print("Resuming exception");' : '') + + 'throw ' + makeGetValue('_llvm_eh_exception.buf', '0', 'void*') + ';'; }); makeFuncLineActor('invoke', function(item) { // Wrapping in a function lets us easily return values if we are @@ -945,7 +946,8 @@ function JSify(data, functionsOnly, givenFunctions) { }); makeFuncLineActor('landingpad', function(item) { // Just a stub - return '{ f0: 0, f1: 0 }'; + return '{ f0: ' + makeGetValue('_llvm_eh_exception.buf', '0', 'void*') + + ', f1:' + makeGetValue('_llvm_eh_exception.buf', QUANTUM_SIZE, 'void*') + ' }'; }); makeFuncLineActor('load', function(item) { var value = finalizeLLVMParameter(item.pointer); diff --git a/src/library.js b/src/library.js index a0160279..3ede01af 100644 --- a/src/library.js +++ b/src/library.js @@ -4320,8 +4320,8 @@ LibraryManager.library = { print('Compiled code throwing an exception, ' + [ptr,type,destructor] + ', at ' + new Error().stack); #endif {{{ makeSetValue('_llvm_eh_exception.buf', '0', 'ptr', 'void*') }}} - {{{ makeSetValue('_llvm_eh_exception.buf', '4', 'type', 'void*') }}} - {{{ makeSetValue('_llvm_eh_exception.buf', '8', 'destructor', 'void*') }}} + {{{ makeSetValue('_llvm_eh_exception.buf', QUANTUM_SIZE, 'type', 'void*') }}} + {{{ makeSetValue('_llvm_eh_exception.buf', 2 * QUANTUM_SIZE, 'destructor', 'void*') }}} throw ptr; }, __cxa_rethrow__deps: ['llvm_eh_exception', '__cxa_end_catch'], @@ -4335,7 +4335,7 @@ LibraryManager.library = { }, llvm_eh_selector__jsargs: true, llvm_eh_selector: function(unused_exception_value, personality/*, varargs*/) { - var type = {{{ makeGetValue('_llvm_eh_exception.buf', '4', 'void*') }}} + var type = {{{ makeGetValue('_llvm_eh_exception.buf', QUANTUM_SIZE, 'void*') }}} for (var i = 2; i < arguments.length; i++) { if (arguments[i] == type) return type; } @@ -4359,13 +4359,13 @@ LibraryManager.library = { // Clear state flag. __THREW__ = false; // Clear type. - {{{ makeSetValue('_llvm_eh_exception.buf', '4', '0', 'void*') }}} + {{{ makeSetValue('_llvm_eh_exception.buf', QUANTUM_SIZE, '0', 'void*') }}} // Call destructor if one is registered then clear it. var ptr = {{{ makeGetValue('_llvm_eh_exception.buf', '0', 'void*') }}}; - var destructor = {{{ makeGetValue('_llvm_eh_exception.buf', '8', 'void*') }}}; + var destructor = {{{ makeGetValue('_llvm_eh_exception.buf', 2 * QUANTUM_SIZE, 'void*') }}}; if (destructor) { FUNCTION_TABLE[destructor](ptr); - {{{ makeSetValue('_llvm_eh_exception.buf', '8', '0', 'i32') }}} + {{{ makeSetValue('_llvm_eh_exception.buf', 2 * QUANTUM_SIZE, '0', 'i32') }}} } // Free ptr if it isn't null. if (ptr) { |