diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-07-15 16:54:28 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-07-15 18:26:40 -0700 |
commit | 52712de67e16d36dd9c1325850c05fd14b00c621 (patch) | |
tree | d0da6ec4d4ba73a089fafb5bbd81106e04470304 /src/jsifier.js | |
parent | 2a408cc988e83353556a910a7dfe3cf021d7cd44 (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/jsifier.js')
-rw-r--r-- | src/jsifier.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 38581ce4..e86a345d 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1498,7 +1498,12 @@ function JSify(data, functionsOnly, givenFunctions) { var returnType = 'void'; if ((byPointer || ASM_JS) && hasReturn) { - returnType = getReturnType(type); + if (callIdent in Functions.implementedFunctions) { + // LLVM sometimes bitcasts for no reason. We must call using the exact same type as the actual function is generated as + returnType = Functions.getSignatureReturnType(Functions.implementedFunctions[callIdent]); + } else { + returnType = getReturnType(type); + } } if (byPointer) { |