aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChad Austin <chad@chadaustin.me>2014-04-29 22:09:13 -0700
committerChad Austin <chad@chadaustin.me>2014-04-29 22:09:13 -0700
commit7da733906454466f4ae22d1a1541ea152f5025db (patch)
treebd803de99a112fe5607ab0026d26078c4f39d3ff /src
parentfee40ad3a5f44adc4b07f41c8f552949a20ce953 (diff)
fix embind/asm.js in PRECISE_F32 mode
Diffstat (limited to 'src')
-rw-r--r--src/embind/embind.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index bb979365..3eadb85f 100644
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -723,9 +723,16 @@ function requireFunction(signature, rawFunction) {
// possibly allocate.
var dc = asm['dynCall_' + signature];
if (dc === undefined) {
- throwBindingError("No dynCall invoker for signature: " + signature);
+ // We will always enter this branch if the signature
+ // contains 'f' and PRECISE_F32 is not enabled.
+ //
+ // Try again, replacing 'f' with 'd'.
+ dc = asm['dynCall_' + signature.replace(/f/g, 'd')];
+ if (dc === undefined) {
+ throwBindingError("No dynCall invoker for signature: " + signature);
+ }
}
- fp = asm['dynCall_' + signature].bind(undefined, rawFunction);
+ fp = dc.bind(undefined, rawFunction);
} else {
fp = FUNCTION_TABLE[rawFunction];
}