aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-07 17:17:55 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-12-07 17:17:55 -0800
commitb7de9da3a411760a4d97a6b4374a1ce99b5c5123 (patch)
tree007b7e990d2067987fe6e46d027eae0f05d8ee59
parentea803456f8885d43f7d0f73a3a38aa8ba5173f5e (diff)
fill in all the function table holes
-rwxr-xr-xemscripten.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/emscripten.py b/emscripten.py
index c9d1b2d5..ad31bff9 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -297,7 +297,7 @@ def emscript(infile, settings, outfile, libraries=[]):
params = ','.join(['p%d' % p for p in range(len(sig)-1)])
coercions = ';'.join(['p%d = %sp%d%s' % (p, '+' if sig[p+1] == 'd' else '', p, '' if sig[p+1] == 'd' else '|0') for p in range(len(sig)-1)]) + ';'
ret = '' if sig[0] == 'v' else ('return %s0' % ('+' if sig[0] == 'd' else ''))
- return 'function %s(%s) { %s abort(%d); %s };\n' % (bad, params, coercions, i, ret) + raw.replace(',0,', ',' + bad + ',').replace(',0]', ',' + bad + ']')
+ return 'function %s(%s) { %s abort(%d); %s };\n' % (bad, params, coercions, i, ret) + raw.replace('[0,', '[' + bad + ',').replace(',0,', ',' + bad + ',').replace(',0,', ',' + bad + ',').replace(',0]', ',' + bad + ']').replace(',0]', ',' + bad + ']')
function_tables_defs = '\n'.join([make_table(sig, raw) for sig, raw in last_forwarded_json['Functions']['tables'].iteritems()])
asm_setup = '\n'.join(['var %s = %s;' % (f.replace('.', '_'), f) for f in ['Runtime.bitshift64', 'Math.floor', 'Math.min']])