diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-01-12 11:59:50 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-01-12 11:59:50 -0800 |
commit | e02762158e8f105fae65583fe9cfe331494b11c7 (patch) | |
tree | 21c776705d2557ddbd4762ef133201f682c7458b /src/library.js | |
parent | 76b5adaf554a0d636ba5eeb9bd1d25659f45167f (diff) | |
parent | ddd3820c79562079e58c7717c5f88c81aac6a379 (diff) |
Merge pull request #170 from FishingCactus/class_exception
Catching specific exception type now works
Diffstat (limited to 'src/library.js')
-rw-r--r-- | src/library.js | 12 |
1 files changed, 6 insertions, 6 deletions
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) { |