diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-06 19:23:34 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-07 14:23:24 -0800 |
commit | f0b6b3d2ad45a81e7d92d7491b38a3cad8a08ef5 (patch) | |
tree | b3f55db088eea10116c76e0ef7530f5f4f2da50a /tools/eliminator | |
parent | cdaf0e156e7eed0d8d591bddc143df55017dfb4f (diff) |
make normalizeAsm not get confused when a var later has an unneeded 'var' before it
Diffstat (limited to 'tools/eliminator')
-rw-r--r-- | tools/eliminator/asm-eliminator-test-output.js | 26 | ||||
-rw-r--r-- | tools/eliminator/asm-eliminator-test.js | 33 |
2 files changed, 58 insertions, 1 deletions
diff --git a/tools/eliminator/asm-eliminator-test-output.js b/tools/eliminator/asm-eliminator-test-output.js index 70eca01a..3170bd9c 100644 --- a/tools/eliminator/asm-eliminator-test-output.js +++ b/tools/eliminator/asm-eliminator-test-output.js @@ -74,4 +74,30 @@ function _vec2Length($this) { STACKTOP = __stackBase__; return 0; } +function exc($this) { + $this = $this | 0; + var $1 = 0, $5 = 0; + $1 = (function() { + try { + __THREW__ = false; + return __ZNSt3__16locale8__globalEv(); + } catch (e) { + if (typeof e != "number") throw e; + if (ABORT) throw e; + __THREW__ = true; + Module.print("Exception: " + e + ", currently at: " + (new Error).stack); + return null; + } + })(); + if (!__THREW__) { + $5 = HEAP32[(($1 | 0) & 16777215) >> 2] | 0; + HEAP32[(($this | 0) & 16777215) >> 2] = $5; + __ZNSt3__114__shared_count12__add_sharedEv($5 | 0); + return; + } else { + $8$0 = ___cxa_find_matching_catch(HEAP32[(_llvm_eh_exception.buf & 16777215) >> 2] | 0, HEAP32[(_llvm_eh_exception.buf + 4 & 16777215) >> 2] | 0, []); + $8$1 = tempRet0; + ___cxa_call_unexpected($8$0); + } +} diff --git a/tools/eliminator/asm-eliminator-test.js b/tools/eliminator/asm-eliminator-test.js index 2fcf90d4..ce34a7a6 100644 --- a/tools/eliminator/asm-eliminator-test.js +++ b/tools/eliminator/asm-eliminator-test.js @@ -99,5 +99,36 @@ function _vec2Length($this) { STACKTOP = __stackBase__; return 0; } -// EMSCRIPTEN_GENERATED_FUNCTIONS: ["asm", "__Z11printResultPiS_j", "_segment_holding", "__ZN5identC2EiPKcPci", "_vec2Length"] +function exc($this) { + $this = $this | 0; + var $1 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $8 = +0, $9 = 0; + var label = 0; + var $1 = (function() { + try { + __THREW__ = false; + return __ZNSt3__16locale8__globalEv(); + } catch (e) { + if (typeof e != "number") throw e; + if (ABORT) throw e; + __THREW__ = true; + Module.print("Exception: " + e + ", currently at: " + (new Error).stack); + return null; + } + })(); + if (!__THREW__) { + $3 = $this | 0; + $4 = $1 | 0; + $5 = HEAP32[($4 & 16777215) >> 2] | 0; + HEAP32[($3 & 16777215) >> 2] = $5; + $6 = $5 | 0; + __ZNSt3__114__shared_count12__add_sharedEv($6); + return; + } else { + $8$0 = ___cxa_find_matching_catch(HEAP32[(_llvm_eh_exception.buf & 16777215) >> 2] | 0, HEAP32[(_llvm_eh_exception.buf + 4 & 16777215) >> 2] | 0, []); + $8$1 = tempRet0; + $9 = $8$0; + ___cxa_call_unexpected($9); + } +} +// EMSCRIPTEN_GENERATED_FUNCTIONS: ["asm", "__Z11printResultPiS_j", "_segment_holding", "__ZN5identC2EiPKcPci", "_vec2Length", "exc"] |