aboutsummaryrefslogtreecommitdiff
path: root/src/modules.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-15 16:54:28 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-15 18:26:40 -0700
commit52712de67e16d36dd9c1325850c05fd14b00c621 (patch)
treed0da6ec4d4ba73a089fafb5bbd81106e04470304 /src/modules.js
parent2a408cc988e83353556a910a7dfe3cf021d7cd44 (diff)
when we are calling an implemented function, call it using the signature it is implemented as, to avoid issues with LLVM casting for no reason
Diffstat (limited to 'src/modules.js')
-rw-r--r--src/modules.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/modules.js b/src/modules.js
index 53d97817..8cfc38de 100644
--- a/src/modules.js
+++ b/src/modules.js
@@ -258,6 +258,15 @@ var Functions = {
return sig;
},
+ getSignatureReturnType: function(sig) {
+ switch(sig[0]) {
+ case 'v': return 'void';
+ case 'i': return 'i32';
+ case 'f': return 'double';
+ default: throw 'what is this sig? ' + sig;
+ }
+ },
+
// Mark a function as needing indexing. Python will coordinate them all
getIndex: function(ident, doNotCreate, sig) {
if (doNotCreate && !(ident in this.indexedFunctions)) {