aboutsummaryrefslogtreecommitdiff
path: root/emscripten.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-07 17:05:48 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-12-07 17:05:48 -0800
commitea803456f8885d43f7d0f73a3a38aa8ba5173f5e (patch)
tree31992d6694e24192bf90ac121db82661cd5b41f6 /emscripten.py
parentb832e0985b0992973c749909fdeb91bcbb4e82a2 (diff)
fix bug in function table filling
Diffstat (limited to 'emscripten.py')
-rwxr-xr-xemscripten.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/emscripten.py b/emscripten.py
index 66e2c721..c9d1b2d5 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 + ']')
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']])