aboutsummaryrefslogtreecommitdiff
path: root/src/modules.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules.js')
-rw-r--r--src/modules.js9
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';