diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-03-02 19:58:52 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-03-02 19:58:52 -0800 |
commit | f46b3d8c5787c895510277c9ab0e2faf646f05ea (patch) | |
tree | 571c3b3658d421f64b97cffecccf733ea39362d5 /emscripten.py | |
parent | ee4b996cd331212686ecbbd03da79bf87b121512 (diff) |
fix ASSERTIONS output on bad function pointer calls
Diffstat (limited to 'emscripten.py')
-rwxr-xr-x | emscripten.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/emscripten.py b/emscripten.py index caf5b7ce..37e1c83f 100755 --- a/emscripten.py +++ b/emscripten.py @@ -924,7 +924,6 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, debug_tables = {} def make_table(sig, raw): - Counter.pre = '' params = ','.join(['p%d' % p for p in range(len(sig)-1)]) coerced_params = ','.join([shared.JS.make_coercion('p%d', unfloat(sig[p+1]), settings) % p for p in range(len(sig)-1)]) coercions = ';'.join(['p%d = %s' % (p, shared.JS.make_coercion('p%d' % p, sig[p+1], settings)) for p in range(len(sig)-1)]) + ';' @@ -943,7 +942,10 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, code += 'return %s' % shared.JS.make_initializer(sig[0], settings) + ';' return name, make_func(name, code) bad, bad_func = make_bad() # the default bad func - Counter.pre = [bad_func] + if settings['ASSERTIONS'] <= 1: + Counter.pre = [bad_func] + else: + Counter.pre = [] start = raw.index('[') end = raw.rindex(']') body = raw[start+1:end].split(',') @@ -959,7 +961,7 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, if settings['ASSERTIONS'] <= 1: return bad if not newline else (bad + '\n') else: - specific_bad, specific_bad_func = make_bad(Counter.j) + specific_bad, specific_bad_func = make_bad(Counter.j-1) Counter.pre.append(specific_bad_func) return specific_bad if not newline else (specific_bad + '\n') if item not in implemented_functions: |