diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-02-18 16:40:53 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-02-18 16:40:53 -0800 |
commit | 9a864d50be044455bcb7626898e58abc406215d9 (patch) | |
tree | d11d298ceac96ecb2c817e22f99b8a87cf762c46 | |
parent | e76757c9213e3bd671eebf0154f379efb8659305 (diff) |
add some asserts in dynCall
-rw-r--r-- | src/runtime.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime.js b/src/runtime.js index 0c724e50..fecd3b68 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -336,6 +336,9 @@ var Runtime = { #if ASM_JS if (!args.splice) args = Array.prototype.slice.call(args); args.splice(0, 0, ptr); +#if ASSERTIONS + assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\''); +#endif return Module['dynCall_' + sig].apply(null, args); #else return FUNCTION_TABLE[ptr].apply(null, args); @@ -345,6 +348,9 @@ var Runtime = { assert(sig.length == 1); #endif #if ASM_JS +#if ASSERTIONS + assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\''); +#endif return Module['dynCall_' + sig].call(null, ptr); #else return FUNCTION_TABLE[ptr](); |