diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-02-26 17:05:07 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-02-26 17:05:07 -0500 |
commit | 2f5e6f993e1b1a446331520b4dc2d5b19d597371 (patch) | |
tree | 970e5a6e77c2540f7e9459bd7fc0df1681eff46b /src/modules.js | |
parent | 0e51f92d800dac9e697a8488c36b62e23bdb0d76 (diff) |
SAFE_DYNCALLS option
Diffstat (limited to 'src/modules.js')
-rw-r--r-- | src/modules.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/modules.js b/src/modules.js index f3c14cd1..7f8a959b 100644 --- a/src/modules.js +++ b/src/modules.js @@ -330,9 +330,16 @@ var Functions = { } } } + if (SAFE_DYNCALLS) { + assert(!ASM_JS, 'cannot emit safe dyncalls in asm'); + for (var j = 0; j < table.length; j++) { + if (table[j] == 0) { + table[j] = "function() { abort('dyncall error') }"; + } + } + } if (table.length > 20) { // add some newlines in the table, for readability - table = table.slice(0); var j = 10; while (j+10 < table.length) { table[j] += '\n'; |