aboutsummaryrefslogtreecommitdiff
path: root/emscripten.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-03-01 11:51:05 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-03-01 13:31:43 -0800
commit0f23cac48fe4e5278e5b35f6a40e6f8a214d5e7c (patch)
treef040a29744747b63ec7a1dda13ceaebe74ea50b3 /emscripten.py
parentcde8796577b2d1959b5322172bec85ba6b10647c (diff)
improve assertions message on function pointer errors
Diffstat (limited to 'emscripten.py')
-rwxr-xr-xemscripten.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/emscripten.py b/emscripten.py
index cb9eefab..eeb53bf7 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -1010,7 +1010,11 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
if other != sig:
extra += other + ': " + debug_table_' + other + '[x] + " '
extra += '"); '
- asm_setup += '\nfunction nullFunc_' + sig + '(x) { Module["printErr"]("Invalid function pointer' + pointer + 'called with signature \'' + sig + '\'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an different type, which will fail?"); ' + extra + ' abort(x) }\n'
+ asm_setup += '\nfunction nullFunc_' + sig + '(x) { Module["printErr"]("Invalid function pointer' + pointer + 'called with signature \'' + sig + '\'. ' + \
+ 'Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? ' + \
+ 'Or calling a function with an incorrect type, which will fail? ' + \
+ '(it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this) ' + \
+ '"); ' + extra + ' abort(x) }\n'
basic_vars = ['STACKTOP', 'STACK_MAX', 'tempDoublePtr', 'ABORT']
basic_float_vars = ['NaN', 'Infinity']